I'm using an Arduino Uno and when I take the 5V pin and I put it in the A5 pin, I still get a signal from the A0 pin. Also, there's a decay over time and it is not on/off (See picture).
I tried reading the A0 pin with the digitalRead() function and it takes a long time to get back to the 0 state. It seems the decay also happens.
How can I make the pins independant from each other and remove the decay from the pins when reading them.
Here's the code I used:
float v1, v2;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(A0, INPUT);
pinMode(A5, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
v1 = analogRead(A0);
v2 = analogRead(A5);
Serial.println(v1);
Thanks!