Just got my first Arduino, and am just taking my first few steps into the world of electronics.
int sensorPin = 0; // select the input pin for the photocell
int sensorValue = 0; // variable to store the value coming from the photocell
int LEDpin = 8; //LED Pin is on the Digital i/o pin number 8
void setup() {
Serial.begin(9600); //Set baud rate to 9600 on the Arduino
pinMode(LEDpin, OUTPUT); //set the LED pin as an output on digital i/o pin 8
}
void loop() {
sensorValue = analogRead(sensorPin); //get the value from input pin
Serial.println(sensorValue); //print the value to Serial monitor
delay(2000);
if (sensorValue < 50) //if there is darkness then turn led on
{
digitalwrite(LEDpin,HIGH);
}
else
{
digitalwrite(LEDpin, LOW); //else, keep the led off
}
}
Just using this example sketch, but I keep getting this error.
error: 'digitalwrite' was not declared in this scope
Any help?