Modelni yig‘ish uchun bizga quyidagilar kerak:
•
Arduino UNO R3 x 1 dona.
•
LCD displey 1602A (2 × 16, 5V, Moviy) x 1 dona.
•
DuPont simli, 2,54 mm, 20 sm, F-F (Ayol-Ayol) x 1 dona.
•
Potentsiometr 10 kOm x 1 dona.
•
PLS-16 ulagichi x 1 dona.
•
MB-102 x 1 dona ishlab chiqish platasi.
•
USB 2.0 A-B kabeli x 1 dona.
Ulanish:
Ulanish uchun biz panel, diagramma va 4-bitli rejimda LCD1602a-ni Arduinoga
ulash uchun jadvaldan foydalanamiz.
Modelning Arduinoga ulanish sxemasi quyidagicha:
Displey plastinkaga PLS-16 pinlari orqali ulanadi (ular displeyga ulangan bo‘lishi
kerak). Displey modulini taxtaga o‘rnating va VDD (2 -pin) 5V (Arduino) va VSS (1 -
pin) GND (Arduino) ga, keyin RS (4 -pin) raqamli pin 8 (Arduino)
#include
int seconds = 0;
LiquidCrystal lcd_1(12, 11, 5, 4, 3, 2);
void setup()
{
lcd_1.begin(16, 2); // Set up the number of columns and rows on the LCD.
// Print a message to the LCD.
lcd_1.print("hello world!");
}
void loop()
{
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting
// begins with 0):
lcd_1.setCursor(0, 1);
// print the number of seconds since reset:
lcd_1.print(seconds);
delay(1000); // Wait for 1000 millisecond(s)
seconds += 1;
}
Do'stlaringiz bilan baham: |