arduino关于红外遥控控制sg90舵机的问题
arduino吧
全部回复
仅看楼主
level 3
pxgg🌙🌟 楼主
每次上传成功后,只有按的第一次有用,后面就回复不过来了是为什么啊,新人求助
2021年06月10日 09点06分 1
level 3
pxgg🌙🌟 楼主
#include <Servo.h>
#include <IRremote.h>
IRrecv irrecv(6);
decode_results results;
Servo myservo;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn();
Serial.println("ok");
myservo.attach(9);
}
void loop() {
if (irrecv.decode(&results)) {
Serial.println(results.value);
if(results.value==16726215) {
myservo.write(0);
}
delay(15);
}
delay(15);
if(results.value==16734885) {
myservo.write(180);
}
delay(100);
}
2021年06月10日 09点06分 2
@欧皇大公举 楼主 你的这个问题解决了吗,我的也是这样,我不知道怎么回事!
2021年12月29日 11点12分
level 3
pxgg🌙🌟 楼主
这是代码
是代码有问题还是我的其他问题啊
2021年06月10日 09点06分 3
level 3
pxgg🌙🌟 楼主
d
2021年06月10日 09点06分 4
level 3
pxgg🌙🌟 楼主
求求了
2021年06月10日 09点06分 5
level 3
pxgg🌙🌟 楼主
有偿
2021年06月10日 09点06分 6
level 3
pxgg🌙🌟 楼主
d
2021年06月10日 09点06分 7
level 3
pxgg🌙🌟 楼主
d
2021年06月10日 09点06分 8
level 3
pxgg🌙🌟 楼主
d
2021年06月10日 10点06分 9
level 3
pxgg🌙🌟 楼主
d
2021年06月10日 10点06分 10
level 8
在delay(100)前面加irrecv.resume()
2021年06月10日 10点06分 11
1