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

我通过串行方式将Arduino连接到计算机,并且可以使用Python(使用pyfirmata库)对Arduino进行基本的数字写入和填充。所以我想知道是否可以将陀螺仪和加速度计与pyfirmata一起使用?


繁华开满天机
浏览 290回答 1
1回答

冉冉说

是的你可以。我对pyfirmata不太了解,但是看起来它是基于pyserial的。我在传递中使用了一点。我会告诉你我对脓毒症的了解在arduino上void setup() {&nbsp;// open the serial port at 9600 bps:&nbsp;Serial.begin(9600);&nbsp;}在PC python终端上>>> ser = serial.Serial()>>> ser.baudrate = 9600&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<--same as the arduino void setup()>>> ser.port = 0&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <--Name of the virtual com port>>> ser.open
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python