-
所需板卡:DFRobot Arduino四路电机驱动板领取理由:熟悉DFRobot各类板卡、传感器,用于完成麦轮小车
-
Gravity LTRUV 390 紫外线传感器
import time
import board
import adafruit_ltr390
i2c = board.I2C()
ltr = adafruit_ltr390.LTR390(i2c)
while True:
print("UV:", ltr.uvs, "\t\tAmbient Light:", ltr.light)
time.sleep(0.1)
-
本帖最后由 doudoubaba 于 2023-11-4 15:43 编辑
ADKey Board 10 Keys(DFR0792)
# ADKey Board 10 Keys
import time
import board
import analogio
analog_pin = analogio.AnalogIn(board.A0)
while True:
ADKeyVal = analog_pin.value
print(ADKeyVal)
if ADKeyVal < 10:
print("K0 Pressed")
if 481 < ADKeyVal or ADKeyVal < 500:
print("K1 Pressed")
if 890 < ADKeyVal or ADKeyVal < 910:
print("K2 Pressed")
if 1188 < ADKeyVal or ADKeyVal < 1208:
print("K3 Pressed")
if 1651 < ADKeyVal or ADKeyVal < 1671:
print("K4 Pressed")
if 2127 < ADKeyVal or ADKeyVal < 2147:
print("K5 Pressed")
if 2447 < ADKeyVal or ADKeyVal < 2467:
print("K6 Pressed")
if 2851 < ADKeyVal or ADKeyVal < 2871:
print("K7 Pressed")
if 3347 < ADKeyVal or ADKeyVal < 3367:
print("K8 Pressed")
if 3713 < ADKeyVal or ADKeyVal < 3733:
print("K9 Pressed")
time.sleep(0.1)
-
火辣西米秀 发表于 2023-10-16 07:31
演示视频和可编译下载的代码是不是没有发出来
没看到
谢谢
-
wangerxian 发表于 2023-6-30 11:37 你这二狗子似乎有点调皮,给它再加个太阳能板,防止跑远了,定位器没电了。
是的,得给二狗子装一对太阳翼