Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <LiquidCrystal.h>
- LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
- int pulsante = 8;
- int val;
- String stringa = "Ciao Mondo!";
- void setup() {
- pinMode(pulsante, INPUT);
- lcd.begin(16, 2);
- lcd.print(stringa);
- }
- void loop() {
- val = digitalRead(pulsante);
- if (val == 1) {
- Destra();
- } else {
- Sinistra();
- }
- }
- void Destra() {
- for (int conta = 0; conta < stringa.length(); conta++) {
- lcd.scrollDisplayRight();
- delay(150);
- }
- }
- void Sinistra() {
- for (int conta = 0; conta < stringa.length(); conta++) {
- lcd.scrollDisplayLeft();
- delay(150);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement