Hello guys, i am having a problem with the PIN 13, the led that most of arduinos have, i made a code that by pushing a button it will turn on or turn off a led, for the led i used the DIGITAL PIN 22 and for the button the DIGITAL PIN 23. the code works fine but after a while the led (PIN 22) turns off and the led (PIN 13) turns on by 2 seconds and turn off that situation happens time after time. I dont know why happen that…
This is the code that i’m using:
int led=22 , pulsador=23 , valor_pulsador, led_2=13;
By the way that problem only happens when i use as a voltage source the arduino’s USB cable, when i use a as voltage source a battery it doesn’t happen.
I tried it with several codes (ADC,serial communication etc.) and the problem keeps happening, i don’t know if it’s the arduino’s USB cable o arduino itself.