changes, build and test script
This commit is contained in:
23
test/test.py
Normal file
23
test/test.py
Normal file
@ -0,0 +1,23 @@
|
||||
import paho.mqtt.client as mqtt
|
||||
|
||||
RGB_TOPIC = 'IoT/RgbLedStripe/ColorCommand'
|
||||
|
||||
|
||||
client = mqtt.Client(client_id = 'test1')
|
||||
|
||||
client.connect("172.16.2.16", 1883, 60)
|
||||
|
||||
i = 0
|
||||
while True:
|
||||
client.loop()
|
||||
|
||||
i += 1
|
||||
if i == 300:
|
||||
i = 0
|
||||
client.publish(RGB_TOPIC, "{0} 0 0 255".format(i))
|
||||
client.publish(RGB_TOPIC, "{0} 0 255 0".format(i+1))
|
||||
client.publish(RGB_TOPIC, "{0} 255 0 0".format(i+2))
|
||||
client.publish(RGB_TOPIC, "{0} 0 0 0".format(i))
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user