How to add numbers in lcd on avr (atmega16)?

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How to add numbers in lcd on avr (atmega16)?

Last Edited: Mon. Jul 16, 2018 - 08:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what lcd? You'll need to be a bit more precise with your question

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

16x2 lcd

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

You need to tell us a lot more. Don't expect us to gaze into a crystal ball and to know exactly what you're asking.

 

So, you've got a 16x2 lcd - which one? Link to product page?

What code are you using to talk to it?

How have you wired it?

What have you done so far? Have you got it to display anything yet?

A zillion people have probably done exactly the same thing as what you want to do and posted it onto the internet. Have you searched?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Learner yo wrote:
How to add numbers in lcd on avr (atmega16)?

Do you mean, "how to display numbers" ?

 

Note that using an LCD does require you to be familiar with a number of basic concepts in both general programming, and microcontrollers in general.

 

It seems that you need to spend some time on these basics before starting with an LCD: https://www.avrfreaks.net/commen...

 

See Tip #6 for some more "Getting Started" tips ... 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The two C functions usually used for converting binary values to a human displayable form (ASCII digits) are either itoa() (that is Integer TO Ascii) or just use sprintf() with %d or %u. In either case you end up with a "string" (or rather a character array). You probably already will have an LCD_printchar() style function for driving your LCD so if the LCD support does not already offer LCD_printstring() then you can create it by repeatedly calling LCD_printchar() for each character in the string until you reach the 0x00 at the end.