Error in read PWM from an RC Receiver
Posted: Mon Feb 15, 2016 7:25 pm
Hi friends, I'm trying to read a pwm signal from my RC Receiver but anything is wrong with the results.
I tryed to run this code:
But it gives me so many random values:
1
10
467
2
1
2
1
2
1
1
1
1
1
2
1
2
1
2
1
4834
44
4873
41
106
76
42
623
1
1
2
393
If I plug an servo to this receiver it works great.
According to this picture this should be the values I need to get.
Could you help me?
I tryed to run this code:
Code: Select all
byte PWM_PIN = D2;
int pwm_value;
void setup() {
pinMode(PWM_PIN, INPUT);
Serial.begin(115200);
}
void loop() {
pwm_value = pulseIn(PWM_PIN, HIGH);
Serial.println(pwm_value);
}
But it gives me so many random values:
1
10
467
2
1
2
1
2
1
1
1
1
1
2
1
2
1
2
1
4834
44
4873
41
106
76
42
623
1
1
2
393
If I plug an servo to this receiver it works great.
According to this picture this should be the values I need to get.
Could you help me?