Can anyone tell me why this keeps throwing up an error please….
const int reedswitch = 2;
const int ledpin = 8;
void setup() {
pinMode(reedswitch, digitalRead);
pinMode(ledpin, digitalWrite);
}
void loop() {
if (digitalRead(reedswitch) == HIGH);{
digitalWrite(ledpin, HIGH);
}
else {
digitalWrite (ledpin, LOW);
}
}
It’s doing my head in now, I’ve been moving the brackets all over the place to try to get it to compile but it keeps throwing up errors.
I can do the basic switching stuff on and off but the if/else thing seems to have me stuck.
As you can probably tell I’m at the start of the learning curve! 😀