Not in scope error

Trying to compile and verify a sketch but 1 error I can't resolve. Please see the following extracts:

/*
const int BUTTON_PIN = 7;
const int RAIN_PIN = 2;

const int serverPort = 4080;
ezButton button(BUTTON_PIN);  // create ezButton that attach to pin 7;

int rain_state = 0;

void setup() {

  pinMode(RAIN_PIN, INPUT);


void loop() {

  // Read input status of pin 2
   rain_state = digitalread(RAIN_PIN); ***
 */type or paste code here

'digitalread' was not declared in this scope

if I remove the line marked *** then all ok.
Please, can someone please tell me where I'm going wrong.
Many thanks
Chris

it should be digitalRead() - note capital R

  • Spelling digitalread digitalRead

You seem to be missing a closing */
You're missing a closing } for the setup function.

So where is the rest of your code?

Thank you Horace and LarrtD,
That was it. You deserve to win the 1% club.
Thanks again, back to it.
Chris

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