I got 14:29 when running this code. Trying to use Ardouino circuits

23 views Asked by At
int switchmode=0;

void setup()
{
  pinMode(3, INPUT);
  pinMode(7, OUTPUT);
  pinMode(9, OUTPUT);
}

void loop()
{
  switchmode = digitalRead(3;
  digitalWrite(7,switchmode);                        
  if(switchmode== HIGH){ 
    digitalWrite(9,HIGH);
    delay(1000);
    digitalWrite(9,LOW);
    delay(1000);
  }
                

I'm running this code on a virtual electric circuit on Tinkercad.com This is sthe error that I get

** In function 'void loop()': 14:29: error: expected ')' before ';' token exit status 1**

1

There are 1 answers

0
Yaser On

I think you miss this bracket here:

//                        ↓
switchmode = digitalRead(3;

// The correct is:
switchmode = digitalRead(3);