-
Notifications
You must be signed in to change notification settings - Fork 0
/
CODE
74 lines (37 loc) · 1.29 KB
/
CODE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
THIS CODE PROGRAM WITH C++
Program to test 16*2 Alaphanumeric LCD with STM32 (Blue Pill)
For: www.circuitdigest.com
The circuit:
* LCD RS pin to digital pin PB11
* LCD Enable pin to digital pin PB10
* LCD D4 pin to digital pin PB0
* LCD D5 pin to digital pin PB1
* LCD D6 pin to digital pin PC13
* LCD D7 pin to digital pin PC14
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
*/
#include <LiquidCrystal.h> // include the LCD library
const int rs = PB11, en = PB10, d4 = PB0, d5 = PB1, d6 = PC13, d7 = PC14; //mention the pin names to with LCD is connected to
LiquidCrystal lcd(rs, en, d4, d5, d6, d7); //Initialize the LCD
int a;
PinMode(PA0,INPUT);
void setup() {
LDR= analogRead(PA0);
lcd.print(a);
lcd.begin(16, 2);//We are using a 16*2 LCD
//At first row first column
lcd.print("Interfacing LCD"); //Print this
lcd.setCursor(0, 1); //At secound row first column
lcd.print("gHASEM KOJAIE?"); //Print this
delay(2000); //wait for two secounds
lcd.clear(); //Clear the screen
}
void loop() {
lcd.setCursor(0, 0); //At first row first column
lcd.print("MEHRDAD--RAEEN"); //Print this
lcd.setCursor(0, 1); //At secound row first column
lcd.print(millis() / 1000); //Print the value of secounds
}