This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:remotelab:itt:relay [2018/12/06 06:36] – rim.puks | en:iot-open:remotelab:itt:relay [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Relay module ===== | + | ===== ITT Relay module ===== |
| This laboratory is located in the office of ITT Group in Tallinn, Estonia. | This laboratory is located in the office of ITT Group in Tallinn, Estonia. | ||
| Line 11: | Line 11: | ||
| ==== Technical details ==== | ==== Technical details ==== | ||
| - | This laboratory consists of a relay module attached to the ITT IoT controller module. | + | This laboratory consists of a relay module attached to the ITT IoT controller module. |
| === Sensors === | === Sensors === | ||
| Line 34: | Line 34: | ||
| ==== Hands-on labs ==== | ==== Hands-on labs ==== | ||
| - | //List study scenarios | + | |
| - | | + | === Example code === |
| - | | + | |
| - | | + | <code c> |
| - | | + | |
| - | Note, assume that more professional group automatically contains less professional ones. Note - use language and as appropriate to the target group, i.e.:// | + | #include < |
| - | < | + | #include < |
| - | | + | |
| - | | + | #define RELAY_PIN 5 |
| - | | + | |
| + | // If the message received switch relay | ||
| + | void iot_received(String topic, String msg) | ||
| + | { | ||
| + | Serial.print(" | ||
| + | Serial.print(topic); | ||
| + | Serial.print(" | ||
| + | | ||
| + | | ||
| + | | ||
| + | digitalWrite(RELAY_PIN, | ||
| + | | ||
| + | |||
| + | if(msg == " | ||
| + | { | ||
| + | digitalWrite(RELAY_PIN, LOW); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | void iot_connected() | ||
| + | { | ||
| + | Serial.println(" | ||
| + | iot.subscribe(" | ||
| + | iot.log(" | ||
| + | } | ||
| + | |||
| + | void setup() | ||
| + | { | ||
| + | | ||
| + | | ||
| + | |||
| + | | ||
| + | iot.setup(); | ||
| + | pinMode(RELAY_PIN, | ||
| + | } | ||
| + | |||
| + | void loop() | ||
| + | { | ||
| + | iot.handle(); | ||
| + | delay(200); | ||
| + | } | ||
| + | |||
| </ | </ | ||
| + | |||
| ==== Support ==== | ==== Support ==== | ||
| - | //Give some information on how to access help, how to get support in case of the trouble etc.// | + | info@ittgroup.ee |