Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
tutorials_devicehub [2016/12/16 08:13]
admin [Sending Commands to the Nodes]
tutorials_devicehub [2017/04/01 06:50] (current)
admin [Sending Commands to the Nodes]
Line 36: Line 36:
 def analog_input(dev,​ sensor): def analog_input(dev,​ sensor):
     value = randint(0, 1023)     value = randint(0, 1023)
-    sensor.addValue(value)+    sensor.addValue(float(value.strip()))
     dev.send()     dev.send()
     print value     print value
Line 222: Line 222:
  
 def act1_callback(payload):​ def act1_callback(payload):​
 +    global red
     print ACT1.state     print ACT1.state
     red = str(ACT1.state)     red = str(ACT1.state)
  
 def act2_callback(payload):​ def act2_callback(payload):​
 +    global green
     print ACT2.state     print ACT2.state
     green = str(ACT2.state)     green = str(ACT2.state)
     ​     ​
 def act3_callback(payload):​ def act3_callback(payload):​
 +    global blue
     print ACT3.state     print ACT3.state
     blue = str(ACT3.state)     blue = str(ACT3.state)
Line 263: Line 266:
 // pins for the LEDs: // pins for the LEDs:
 const int redPin = 8; const int redPin = 8;
-const int greenPin = 11+const int greenPin = 11;
 const int bluePin = 10; const int bluePin = 10;