Hello, I'm currently working with my arduino uno, and i noticed sections of my script triggering when I had not intended for them to be triggered, then i tracked the issue to my analog input.
the analog inputs A0 through A5 are all displaying absolutely random readings.
Here's my output:
292--286--296--0--0--81--272--442--439--642--668--739--779--804--739--578--485--405--348--282--276--283--280--0--70--131--160--260--362--45
and my code:
int x = A1;
void setup()
{
pinMode(x,INPUT);
Serial.begin(9600);
}
void loop()
{
int var = analogRead(x);
Serial.print(var);
Serial.print("--");
delay(500);
}
I used this code to test my theory of these random readings, and sure enough it was true.
This is an issue.
My trigger uses a the analog inputs to read the power from the 3.3V power source on the arduino.
Running this script, 671 is often printed, and that's causing my script to fire when i do not want it to.
Does anyone know why this is happening?
Note:
The A1 port is totally disconnected from anything, and i've even lifted the Arduino Uno in the air so it's suspended by it's cable to the computer, yet these random readings are still there.
Moderator edit:
[code] [/code] tags added.