UIFlow Guide
from m5stack import *
from m5stack_ui import *
from uiflow import *
from IoTcloud.AWS import AWS
import time
screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)
label0 = M5Label('Text', x=40, y=42, color=0x000, font=FONT_MONT_38, parent=None)
label1 = M5Label('Text', x=43, y=134, color=0x000, font=FONT_MONT_38, parent=None)
def fun_subtopic_(topic_data):
# global params
label0.set_text(str(topic_data))
pass
aws = AWS(things_name='UIFlow_TEST', host='xxxxxxxxxxx-ats.iot.ap-southeast-1.amazonaws.com', port=8883, keepalive=60, cert_file_path="/flash/res/certificate.pem.crt", private_key_path="/flash/res/private.pem.key")
aws.subscribe(str('subtopic'), fun_subtopic_)
aws.start()
while True:
aws.publish(str('pubtopic'),str('hello'))
wait(4)
wait_ms(2)
from IoTcloud.AWS import AWS
aws = AWS(things_name='', host='', port=0, keepalive=0, cert_file_path='', private_key_path='')
aws.start()
aws.publish(topic,msg)
def fun_subtopic_(topic_data):
# global params
print(topic_data)
pass