Arduino伺服不旋转所有齿轮

问题描述

我已经创建了使用arduino和IR Remote旋转9g Microservo的代码。每当我将代码上传到arduino时,微型伺服器中的两个齿轮就开始旋转而没有输入,但它们却不旋转其他齿轮或伺服器的头部。按下IR遥控器上的正确按钮后,旋转齿轮不会改变,并且arduino上的其他位置也没有明显变化。

#include <IRremote.h>
#include <Servo.h>
#define FF22DD 0xA732
#define FF02FD 0xA732
int IRpin = 11;  // pin for the IR sensor
IRrecv irrecv(IRpin);
decode_results results;
Servo myservo;

void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}

void loop() {
  if (irrecv.decode(&results)) {
    irrecv.resume();   // Receive the next value
  }
  
  if (results.value == FF22DD) {  // Value responding to VOL -
    myservo.write(0);
    delay(15);
  }

  if (results.value == FF02FD) { // Value responding to VOL +
    myservo.write(30);
    delay(15);
  }
}   

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)