a place for robotic enthusiasts, builders and user groups

#include
LiquidCrystal lcd( 10, 11, 12, 13, 14, 15, 16 );
int buttonPin = 8;
int buzzerPin = 9;
int val = 0;
void setup()
{
Serial.begin( 9600 );
lcd.begin( 16, 2 );
lcd.clear();
pinMode( buttonPin, INPUT );
pinMode( buzzerPin, OUTPUT );
}
void loop()
{
lcd.setCursor( 0, 0 );
val = digitalRead( buttonPin );
if( val == HIGH )
{
lcd.println( "button pressed " );
digitalWrite( buzzerPin, HIGH );
}
else if( val == LOW )
{
lcd.println( "nothing pressed " );
digitalWrite( buzzerPin, LOW );
}
else lcd.println( "unknown state" );
delay( 1000 );
lcd.clear();
}
Peter Farkas posted a video
Peter Farkas posted a blog post© 2012 Created by Danny.
| Add Videos | Add Photos | Post a Blog | Add Events | Discuss | Form a Group | ||
Sign Up Invite |