int ledPin = 13;
int switchPin = 9;
int switchValue = HIGH;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(switchPin, INPUT_PULLUP);
}
void loop() {
switchValue = digitalRead(switchPin);
digitalWrite(ledPin, switchValue);
delay(50);
}
Do we have to guess what the error is?
The sketch is irrelavent when the error is in the upload. It obviously compiled, or there would have been no attempt to upload.