R
Size: a a a
R
Я
VB
VB
R
VB
R
R
R
Я
Я
Я
Я
R
R
Я
Я
R
Я
#include <LCD5110_Basic.h>
LCD5110 LCD(8,9,10,11,12);
extern uint8_t SmallFont[];
extern uint8_t MediumNumbers[];
extern uint8_t BigNumbers[];
int a, x;
unsigned long last_time;
void setup() {
LCD.InitLCD();
pinMode (A0, INPUT);
Serial.begin(9600);
LCD.clrScr();
LCD.setFont(SmallFont);
LCD.print("Moisture", 0, 0);
}
void loop() {
if (millis() - last_time > 5000) {
a = analogRead (A0);
x = map(a, 600, 235, 0, 100);
Serial.print (x);
Serial.println ('%');
LCD.setFont(SmallFont);
LCD.print(x, 0, 15);
last_time = millis();
}
}