code not compiling

here's my code

int onpin = 3;
int offpin = 4;
int tiggerpin = 7;

void setup() {
  pinMode(onpin, INPUT)
  pinMode(offpin, INPUT)
  pinMode(triggerpin, OUTPUT)
}
void loop() {
digitalRead(onpin) HIGH
if(HIGH)
  digitalWrite(triggerpin) HIGH
  
  delay(30000)
}

i keep getting the ERROR COMPILING message

i reran the boot loader but did nothing

please help!:slight_smile:

I suggest you read/view a basic cc++ and/or Arduino tutorial or two. Or even look at a very basic Arduino example, like blink.ino. Your syntax has several very basic problems.

Regards,
Ray L.

int onpin = 3;
int offpin = 4;
int triggerpin = 7;

void setup() {
  pinMode(onpin, INPUT);
  pinMode(offpin, INPUT);
  pinMode(triggerpin, OUTPUT);
}
void loop() {
   digitalRead(onpin);
if(HIGH)
  digitalWrite(triggerpin,HIGH) ;
  
  delay(30000);
}

:o

if(digitalRead(onpin) == HIGH)
{
    digitalWrite(triggerpin,HIGH) ;
}

There is a language reference.

https://www.arduino.cc/en/Reference/If