Sorry if my code isn't well written or anything because I'm new to Arduino and coding in C, but what is wrong with my code?
int sidepin = 2;
int LED = 5;
int val;
void setup() {
pinMode(sidepin, INPUT);
pinMode(LED, OUTPUT);
}
void loop() {
val = digitalRead(sidepin);
if(val = 0)
{
pinMode(LED, HIGH);
}
else(val > 0)
{
pinMode(LED, LOW);
}
}
else(){}
looks like bad syntax. – Dave X Jun 20 '16 at 20:15