62 lines
1.2 KiB
Arduino
62 lines
1.2 KiB
Arduino
|
/*
|
||
|
LiquidCrystal Library - display() and noDisplay()
|
||
|
|
||
|
Demonstrates the use a 16x2 LCD display.
|
||
|
|
||
|
This sketch uses the display() and noDisplay() functions
|
||
|
to turn on and off the display.
|
||
|
|
||
|
The circuit:
|
||
|
* LCD RS pin to digital pin 12
|
||
|
* LCD Enable pin to digital pin 11
|
||
|
* LCD D4 pin to digital pin 9
|
||
|
* LCD D5 pin to digital pin 8
|
||
|
* LCD D6 pin to digital pin 7
|
||
|
* LCD D7 pin to digital pin 6
|
||
|
* LCD R/W pin to ground
|
||
|
* 10K resistor:
|
||
|
* ends to +5V and ground
|
||
|
* wiper to LCD VO pin (pin 3)
|
||
|
*/
|
||
|
|
||
|
// include the library code:
|
||
|
#include <LiquidCrystal.h>
|
||
|
|
||
|
// initialize the library with the numbers of the interface pins
|
||
|
LiquidCrystal lcd(12, 11, 9, 8, 7, 6);
|
||
|
byte fil;
|
||
|
byte col;
|
||
|
byte cont;
|
||
|
|
||
|
void setup() {
|
||
|
lcd.begin(16, 2);
|
||
|
fil = 0;
|
||
|
col = 0;
|
||
|
cont = 0;
|
||
|
}
|
||
|
|
||
|
void loop() {
|
||
|
for (int i=0; i<8; i++) {
|
||
|
lcd.clear();
|
||
|
lcd.setCursor(col++ , fil);
|
||
|
lcd.print("FuzanToko");
|
||
|
lcd.noDisplay();
|
||
|
delay(100);
|
||
|
lcd.display();
|
||
|
delay(300);
|
||
|
}
|
||
|
fil += 1;
|
||
|
col = 7;
|
||
|
for (int j=0; j<8; j++) {
|
||
|
lcd.clear();
|
||
|
lcd.setCursor(col-- , fil);
|
||
|
lcd.print("FuzanToko");
|
||
|
lcd.noDisplay();
|
||
|
delay(100);
|
||
|
lcd.display();
|
||
|
delay(300);
|
||
|
}
|
||
|
setup();
|
||
|
}
|
||
|
|