Pages: [1]   Go Down
Author Topic: easy software problem  (Read 204 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I am creating my first arduino project, it is a robot that starts if the pir sensor goes off.  The part i am having difficulties with is here,

void loop(){

     if(digitalRead(pirPin) == HIGH){
         digitalWrite(buzzPin, HIGH);   //the buzzer visualizes the sensors output pin state
         delay (1000);  //high for 1 sec
         digitalWrite(buzzpin, LOW);
         delay (1000);  //low for 1 sec
       digitalWrite(robopin, HIGH);   //output pin state of pir pin
       delay (50000);

It says that I need to declare buzzpin in this scope (the one when buzzpin is low).  If you know how to help me I would greatly appreciate it!
Logged

North Queensland, Australia
Offline Offline
Edison Member
*
Karma: 53
Posts: 1785
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

check the variable names, it needs to match exatly.
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 509
Posts: 31452
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

buzzpin is not the same as buzzPin

The C language is case sensitive.
Logged

Pages: [1]   Go Up
Jump to: