led
display
speaker
sound_sensor
light_sensor
potentiometer
button_a
button_b
button_c
motion_sensor
ir
wifi
battery
codey_timer
codey_broadcast
codey_external_module_detect
codey_script_control
event
codey_broadcast 模块的主要功能与函数(因为是系统函数,所以使用时不需要带模块名称)
codey.
broadcast
可以向串口,蓝牙以及自身的事件监听单元发送一个广播,参数:
str 广播的内容。
import codey import event @event.button_a_pressed def button_a_cb(): print("button a event succeeded") codey.broadcast("hello") @event.received("hello") def received_cb(): print("received message: hello")