cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the LCD hangs when it prints negative numbers in the form -xxxx?

M7890.1
Associate III

The LCD hangs when it prints negative numbers lesser than -999, or more specifically, the whole program hangs. Does anyone know the reason for this? I have attached my code below.

(The code is too long to be pasted here, I attached the file.)

1 ACCEPTED SOLUTION

Accepted Solutions

Try making the buffer big enough to hold all the characters and a trailing NUL

char lcd_data[8]; // try 16

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

Try making the buffer big enough to hold all the characters and a trailing NUL

char lcd_data[8]; // try 16

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
M7890.1
Associate III

Tried that and solved my problem. Thanks!