它一直显示第二行就错了,到底什么地方有问题?

#includeServo Xservo;Servo Yservo;Servo Zservo;int Xpitch=90;int Ypitch=90;int Zpitch=90;void setup(){ Xservo.attach(9); Yservo.attach(10); Zservo.attach(11); delay(100); Xservo.write(90); Yservo.write(90); Zservo.write(90); delay(1000);}void loop(){ int analogValueX=analogRead(0); int analogValueY=analogRead(1); int analogValueZ=analogRead(2); Xpitch=map(analogValueX,610,910,65,125 ); Xservo.write(Xpitch); Ypitch=map(analogValueY,510,700,20,160); Yservo.write(Ypitch); Zpitch=map(analogValueZ,750,865,20,160); Zservo.write(Zpitch); }

回首忆惘然
浏览 124回答 2
2回答

慕森卡

#include <Servo.h>建议将analogValueX,analogValueY,analogValueZ 放到函数外定义

陪伴而非守候

#include <Servo.h>才对吧
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Android
Java