4876浏览
楼主: 驴友花雕

[MP动手做] MicroPython动手做(22)——掌控板之无线广播

[复制链接]

驴友花雕  中级技神
 楼主|

发表于 2020-5-7 15:15:46

#MicroPython动手做(22)——掌控板之无线广播

#自控行人过马路交通信号灯(视频)




https://v.youku.com/v_show/id_XNDY2MzExODA0NA==.html?spm=a2h0c.8166622.PhoneSokuUgc_1.dtitle





回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2020-5-7 15:32:36

MicroPython动手做(22)——掌控板之无线广播图2

MicroPython动手做(22)——掌控板之无线广播图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2020-5-9 15:09:56

6、远距离控制光线采集与记录

#MicroPython动手做(22)——掌控板之无线广播
#远距离控制光线采集与记录(控制端)

  1. #MicroPython动手做(22)——掌控板之无线广播
  2. #远距离控制光线采集与记录(控制端)
  3. import radio
  4. from mpython import *
  5. import time
  6. radio.on()
  7. radio.config(channel=5)
  8. oled.fill(0)
  9. oled.DispChar("光线数据采集", 0, 0, 1)
  10. oled.DispChar("按A键采集,按B键结束", 0, 16, 1)
  11. oled.show()
  12. while True:
  13.     if button_a.value() == 0:
  14.         rgb[1] = (int(0), int(102), int(0))
  15.         rgb.write()
  16.         time.sleep_ms(1)
  17.         oled.fill_rect(0, 32, 128, 16, 0)
  18.         oled.DispChar((str(light.read())), 0, 32, 1)
  19.         oled.show()
  20.         radio.send((str(light.read())))
  21.         time.sleep_ms(100)
  22.     if button_b.value() == 0:
  23.         rgb[1] = (int(102), int(0), int(0))
  24.         rgb.write()
  25.         time.sleep_ms(1)
  26.         oled.fill_rect(0, 32, 128, 16, 0)
  27.         oled.show()
  28.         radio.off()
复制代码
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2020-5-9 15:15:09

#MicroPython动手做(22)——掌控板之无线广播
#远距离控制光线采集与记录(接收端)

  1. #MicroPython动手做(22)——掌控板之无线广播
  2. #远距离控制光线采集与记录(接收端)
  3. import radio
  4. from mpython import *
  5. import time
  6. radio.on()
  7. radio.config(channel=5)
  8. oled.fill(0)
  9. oled.DispChar('光线数据接收', 0, 0, 1)
  10. oled.show()
  11. time.sleep_ms(50);print(('__TITLE', '光线'));time.sleep_ms(50)
  12. while True:
  13.     aaa = radio.receive()
  14.     oled.fill_rect(0, 16, 128, 16, 0)
  15.     oled.DispChar((str(aaa)), 0, 16, 1)
  16.     oled.show()
  17.     if aaa != None:        print((int(aaa),))
  18.         time.sleep_ms(100)
复制代码

回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2020-5-9 15:18:47

采集到的光线数据波形

MicroPython动手做(22)——掌控板之无线广播图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2020-5-9 15:22:30

光线采集控制端(mPython X 图形编程)

MicroPython动手做(22)——掌控板之无线广播图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2020-5-9 15:29:30

接收光线数据端(mPthon 图形编程)

MicroPython动手做(22)——掌控板之无线广播图1
回复

使用道具 举报

驴友花雕  中级技神
 楼主|

发表于 2020-5-9 15:34:35

MicroPython动手做(22)——掌控板之无线广播图1
回复

使用道具 举报

12
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail