Print ASCII number for characters on LCD 16X2

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

circuit diagram - connection of lcd with arduino
Circuit Diagram – Connection of LCD 16×2 with Arduino

* POT = Potentiometer = Variable resistor

CONNECTION TABLE

S.N.Arduino PinLCD pin
1.1. VSSGround (0V)
2.2. VCC+ 5V
3.3. VEE10K POT
4.24. RS
5.5. RWGround
6.36. E
7.7. D0-
8.8. D1-
9.9. D2-
10.10. D3-
11.411. D4
12.512. D5
13.613. D6
14.714. 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

Print ASCII number for characters on LCD 16x2 using Arduino
Print ASCII number for characters “A, b, #” on LCD

 


READ NEXT
DISPLAY DATA ON LCD 16×2 ON AN INPUT BY A SWITCH USING ARDUINO


 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x