I'm trying to get my Arduino to receiver PWM signals from a radio controller.
However whenever I insert a wire random numbers will start appearing ranging from 0 to 10,000. I don't know what to do now, and I'm on a time crunch any help is much appreciated
Schematic (NOT Fritzing) , code (in code brackets) and more detail would also help.
Other than that, yonks of info on internet on how to using Google search.
This is the first one that came up in the blink of an eye. https://www.youtube.com/watch?v=UZKxUFkwCc8
Are you by, any chance, trying to print out numbers generated by reading the value of an analogue input?
Otherwise my crystal ball predicts the problem is on line 34 of your un-posted code. But it could just be that its battery is running down.
Another big tip is never make wiring changes when a circuit is powered up. That is the best way to destroy a chip, and you will have no idea why it stopped working.
Here is my sketch it. To test the board I wanted to just isolate one channel
#define RCpin 5
int RCValue;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(RCpin,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
RCValue = pulseIn(RCpin,HIGH);
Serial.println(RCValue);
}
I have 3 Arduinos that I have tried this on. 2 Elegoos and 1 official Arduino UNO board. So I'm not sure if all my boards are bad. I don't know how to tell if they are. I'm using a TS8 Radio transmitter with the supplied receiver. I supply power to the receiver by using a battery (not the Arduino). In frustration I have changed the pins while the Arduino was live. At one point I had a flysky that worked until about 4 days ago.
Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels.
Can you post some images of your project?
So we can see your component layout.
You do have the gnd of the Arduino connected to the gnd of the radio?
And make sure that the battery is switched off before pulling the power on the rest of the Arduino. Otherwise you will get what is known as phantom powering, where the battery tries to power the Arduino through its static protection diodes. Which will damage the Arduino.
So you need a switch in the +ve line of the battery.
Hello everyone wanted to say thank you for all your support. It was the ground wire that I didn't have. I now have everything coming out of the Arduino itself. I have a steady and predictable serial output. Below is a drawing of my pinouts and what I was trying to do. Thank you for all of the advice, especially on how fast this was resolved.