Table of Contents
In the previous topic you learned How to print ASCII characters on LCD & ASCII Table, here you will see, How to print ASCII number for characters on LCD 16×2 using Arduino
CIRCUIT DIAGRAM
* POT = Potentiometer = Variable resistor
CONNECTION TABLE
S.N. | Arduino Pin | LCD pin | |
---|---|---|---|
1. | 1. VSS | Ground (0V) | |
2. | 2. VCC | + 5V | |
3. | 3. VEE | 10K POT | |
4. | 2 | 4. RS | |
5. | 5. RW | Ground | |
6. | 3 | 6. E | |
7. | 7. D0 | - | |
8. | 8. D1 | - | |
9. | 9. D2 | - | |
10. | 10. D3 | - | |
11. | 4 | 11. D4 | |
12. | 5 | 12. D5 | |
13. | 6 | 13. D6 | |
14. | 7 | 14. D7 | |
15. | 15. Anode + | + 5V | |
16. | 16. Cathode - | 0V (Ground) |
ARDUINO CODE TO PRINT ASCII NUMBER FOR CHARACTERS
Program for printing ASCII number for the character ‘A’, ‘b’ and ‘#’ which are stored in character type variables s1, s2 and s3 respectively.
#include<LiquidCrystal.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); char s1 = 'A', s2 = 'b', s3 = '#'; int a, b, c; void setup() { lcd.begin(16, 2); lcd.print("Hello"); delay(1000); lcd.clear(); } void loop() { a = s1; b = s2; c = s3; lcd.setCursor(0, 0); lcd.print(a); lcd.print(" "); delay(1000); lcd.clear(); lcd.setCursor(0, 0); lcd.print(b); lcd.print(" "); delay(1000); lcd.clear(); lcd.setCursor(0, 0); lcd.print(c); lcd.print(" "); delay(1000); lcd.clear(); // to not repeat the loop again and again while (1); }
OUTPUT
READ NEXT
DISPLAY DATA ON LCD 16×2 ON AN INPUT BY A SWITCH USING ARDUINO