高级会员
主题
回帖0
积分4686
阅读权限30
注册时间2010-3-29
最后登录1970-1-1
在线时间 小时
|
楼主 |
发表于 2013-8-3 11:35
|
显示全部楼层
板输入5V和GND,输出只接 XOUT和 ZOUT
int x, z;void setup(){ Serial.begin(9600); // sets the serial port to 9600}void loop(){ x = analogRead(0); // read analog input pin 0 z = analogRead(1); // read analog input pin 1 Serial.print("rotational rates are x, z: "); Serial.print(x, DEC); // print the rotational rate in the X axis Serial.print(" "); // prints a space between the numbers Serial.println(z, DEC); // print the rotational rate in the Z axis delay(100); // wait 100ms for next reading}
|
|