newbie programme issues


hi guy's, trying first project , getting following error code;

exit status 1
error compiling board arduino/genuino mega or mega 2560

i cant find way around it, please help.

see code below;



// simple led on/off via breadboard switch

int ledpin = 13;  // led connected pin 13
int switchpin = 8;  // switch connected pin 8

void setup()
{
pinmode (ledpin, output);  // pin 13 output
pinmode (switchpin, input);  // pin 8 input
ledpin low;  //default led low
}

void loop()
{
 
if  (switchpin == high)  // if pin 8 reads high


   digitalwrite (ledpin, high); // sets led high
 }

 else // if led reads low

{
  digitalwrite (ledpin, low);  // sets led lows
}

}

code: [select]
if  (switchpin == high)
it seems unlikely 8 ever equal 1

please post full error message


Arduino Forum > Using Arduino > Programming Questions > newbie programme issues


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor