I'm having trouble uploading a simple program to my Arduino Uno.
Using an analog pin to read the closing of a switch and outputing it through a digital pin
Here's the code:
int PinA=4;
bool a=false;
bool B=false;
void setup(){
pinMode(A0, INPUT);
pinMode(PinA, OUTPUT);
Serial.begin(9600);
}
void loop(){
B=digitalRead(A0);
a=B;
digitalWrite(PinA,a);
}
Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"
Sketch uses 1896 bytes (5%) of the program storage space. The maximum is 32256 bytes.
Global variables use 184 bytes (8%) of dynamic memory, leaving 1864 bytes for local variables. The maximum is 2048 bytes.
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xfd
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x48
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x40
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xf2
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x52
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1d
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x71
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x82
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x02