为了账号安全,请及时绑定邮箱和手机立即绑定

我可以使用Python(带有pyfirmata)从连接到Arduino的陀螺仪读取和使用数据吗?

我可以使用Python(带有pyfirmata)从连接到Arduino的陀螺仪读取和使用数据吗?

繁华开满天机 2021-03-18 17:12:17
我通过串行方式将Arduino连接到计算机,并且可以使用Python(使用pyfirmata库)对Arduino进行基本的数字写入和填充。所以我想知道是否可以将陀螺仪和加速度计与pyfirmata一起使用?
查看完整描述

1 回答

?
冉冉说

TA贡献1877条经验 获得超1个赞

是的你可以。


我对pyfirmata不太了解,但是看起来它是基于pyserial的。我在传递中使用了一点。我会告诉你我对脓毒症的了解


在arduino上


void setup() {

 // open the serial port at 9600 bps:

 Serial.begin(9600);

 }

在PC python终端上


>>> ser = serial.Serial()

>>> ser.baudrate = 9600         <--same as the arduino void setup()

>>> ser.port = 0                <--Name of the virtual com port

>>> ser.open


查看完整回答
反对 回复 2021-03-24
  • 1 回答
  • 0 关注
  • 289 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信