Arduino Code For Wireless Notice Board
#include <LiquidCrystal.h>
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
char str;
int a=9;
int vo=10;
void setup() {
lcd.begin(16,2);
Serial.begin(9600);
}
void loop() {
analogWrite(a,700);
analogWrite(vo,122);
while(Serial.available())
{
str = Serial.read();
if(str=='#')
{
lcd.clear();
delay(5);
}
else if(str=='*')
{
lcd.setCursor(0, 1);
}
else if(str=='%')
{
while(str!='!')
{
str=Serial.read();
lcd.scrollDisplayLeft();
delay(1000);
}
}
else
{
lcd.print(str);
delay(100);
}
}
}
Comments
Post a Comment