If statement problems

Hi
I have started a piece of code to use for a project but upon creating an if statement I got an error message

if (digitalRead)stopU) == LOW) {
^
exit status 1
expected ';' before ')' token

in this code

#define CW 7
#define ACW 8
#define switchA 0
#define switchB 1
#define stopU 2
#define stopB 3

void setup() {
  // put your setup code here, to run once:
  pinMode(CW, OUTPUT);
  pinMode(ACW, OUTPUT);
  pinMode(switchA, INPUT_PULLUP);
  pinMode(switchB, INPUT_PULLUP);
  pinMode(stopU, INPUT_PULLUP);
  pinMode(stopB, INPUT_PULLUP);
}

void loop()
{
  if (digitalRead)stopU) == LOW) {
    digitalWrite(CW, HIGH);
  }
}

It is probably obvious to you but it has stumped me
Thanks for the help

if (digitalRead)stopU) == LOW)

Should be

if (digitalRead(stopU) == LOW)

Take a look at the supplied examples in the IDE!

Empty imported post

endermaker:

invisible ink answer :slight_smile: from @endermaker

Yep sorry I just saw that
Arduino error message wasn't clear to me.
Thanks for the help

The caret in the error did give it away.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.