Отображаем на LCD дисплее 1602A увеличивающийся счетчик
| 07.11.2016, 12:17 | |
Работа с LCD дисплеем
/*
Отображаем на LCD дисплее 1602A увеличивающийся счетчик
*/
#include <LiquidCrystal.h> // Лобавляем необходимую библиотеку
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // (RS, E, DB4, DB5, DB6, DB7)
int count;
char buf[32];
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("Hello world!");
lcd.setCursor(0,1);
lcd.print("Arduino World");
//
count=0;
}
void loop() {
// put your main code here, to run repeatedly:
lcd.setCursor(0,0);
count++;
itoa(count, buf, 10);
lcd.print(buf); lcd.print(" ");
delay(1000);
}
| |
| Категория: Arduino | | |
| Просмотров: 495 | Загрузок: 0 | |