NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Writing Big Numbers to the LCD
November 23, 2009 by FWSquatch |
I've got a project that I'm trying to debug through the LCD. It is supposed to be writing the interval in ms that the MCU is supposed to wait before going to the next thing. Sometimes this number is pretty big (6 digits) and for some reason, I can't get the LCD to write it out correctly. I suspect it has to do with what type of variable I am using, but I've tried a few different types and I can't figure it out. Here is relevant code:
Here is what I get. As you can see, it's giving me some random negative number when it should be showing 235998. Does anyone know what I'm doing wrong? |
---|---|
November 24, 2009 by n3ueaEMTP |
FWSquatch, I have been having the same problem. I posed the same question in this other thread, it should answer your question. Chris B, n3ueaEMTP |
November 24, 2009 by tech20 |
it's a problem with memory i think, the integer is to large to display correctly since the function is for 16 bit integers, unsigned. You may have to make a function to support it, or use smaller numbers :P. |
November 24, 2009 by FWSquatch |
Thanks, Chris! It works perfect now! |
Please log in to post a reply.
Did you know that you can turn a $20 digital scale into a live weight sensor using our kit with a few extra parts? Learn more...
|