我通过串行方式将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
添加回答
举报
0/150
提交
取消