codey_broadcast --- 广播模块

codey_broadcast 模块的主要功能与函数(因为是系统函数,所以使用时不需要带模块名称)

功能相关函数

codey.broadcast(str)

可以向串口,蓝牙以及自身的事件监听单元发送一个广播,参数:

  • 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")