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
Last revision Both sides next revision
tutorials_devicehub [2016/12/16 09:13]
admin [Sending Commands to the Nodes]
tutorials_devicehub [2017/04/01 07:45]
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)