expected '(' before

I get the error

digitalWrite Buzzer (HIGH)
** ^~~~~~**
exit status 1
expected '(' before 'CrashSwitch'

and if I put it in brackets it gives me the error "expected primary-expression before '=' token"

what am I doing wrong

#include <SoftwareSerial.h>
SoftwareSerial SIMA6 (10, 11);

void setup() {
  Serial.begin(115200);
  SIMA6.begin(115200);
  


}

void loop() {
int CrashSwitch = digitalRead(2);
if CrashSwitch = HIGH {
    digitalWrite Buzzer (HIGH)
  }



}

It's literally telling you what the problem is.

Have look in Resource/Reference at the top of the page (or just about every IDE example or program on these forums) for the correct format of an if statement. HINT it needs the () brackets.

Steve

Computers can't "understand" language like people can (usually). They only follow a strict set of rules to know what to do. That is why you have to learn and follow the rules exactly.

Look at this. And remember when your compiler throws an error look at ALL the errors it throws not just one. Also the “=“ is for assignment only, “==“ tests the condition.

int CrashSwitch = digitalRead(2);
if (CrashSwitch == HIGH) {
digitalWrite(Buzzer, HIGH);
}