#自控行人过马路交通信号灯(视频)
https://v.youku.com/v_show/id_XNDY2MzExODA0NA==.html?spm=a2h0c.8166622.PhoneSokuUgc_1.dtitle
https://v.youku.com/v_show/id_XNDY2MzExODA0NA==.html?spm=a2h0c.8166622.PhoneSokuUgc_1.dtitle
6、远距离控制光线采集与记录
#MicroPython动手做(22)——掌控板之无线广播
#远距离控制光线采集与记录(控制端)
#MicroPython动手做(22)——掌控板之无线广播
#远距离控制光线采集与记录(控制端)
import radio
from mpython import *
import time
radio.on()
radio.config(channel=5)
oled.fill(0)
oled.DispChar("光线数据采集", 0, 0, 1)
oled.DispChar("按A键采集,按B键结束", 0, 16, 1)
oled.show()
while True:
if button_a.value() == 0:
rgb = (int(0), int(102), int(0))
rgb.write()
time.sleep_ms(1)
oled.fill_rect(0, 32, 128, 16, 0)
oled.DispChar((str(light.read())), 0, 32, 1)
oled.show()
radio.send((str(light.read())))
time.sleep_ms(100)
if button_b.value() == 0:
rgb = (int(102), int(0), int(0))
rgb.write()
time.sleep_ms(1)
oled.fill_rect(0, 32, 128, 16, 0)
oled.show()
radio.off() #MicroPython动手做(22)——掌控板之无线广播
#远距离控制光线采集与记录(接收端)
#MicroPython动手做(22)——掌控板之无线广播
#远距离控制光线采集与记录(接收端)
import radio
from mpython import *
import time
radio.on()
radio.config(channel=5)
oled.fill(0)
oled.DispChar('光线数据接收', 0, 0, 1)
oled.show()
time.sleep_ms(50);print(('__TITLE', '光线'));time.sleep_ms(50)
while True:
aaa = radio.receive()
oled.fill_rect(0, 16, 128, 16, 0)
oled.DispChar((str(aaa)), 0, 16, 1)
oled.show()
if aaa != None: print((int(aaa),))
time.sleep_ms(100)
采集到的光线数据波形
光线采集控制端(mPython X 图形编程)
接收光线数据端(mPthon 图形编程)
页:
1
[2]