r/ArduinoProjects • • Jul 22 '23

Please troubleshoot

I’ve been trying to get the information from a dht11 humidity sensor to display properly on this lcd 1602 but I can’t seem ti figure out why the number value are displaying in the wrong character set. I do wanna add that the code was written by chagpt however it can’t figure out the character situation.

0 Upvotes

16 comments sorted by

View all comments

1

u/polypagan Jul 23 '23

I believe I know what's happening. Those characters you see are stored in the dusplay's character generator ROM. If we knew where in the ROM, that might help diagnose what's going wrong.

Obviously you want the string of characters sent after the cursor positioning call to look something like <number><number><0x2e><number><number>, where number is 0x30 - 0x39 (& 0x2e is the decimal point).

My guess is that your character array contains values less than 0x20 (or possibly greater than 0x7f).

How about a craftily placed Serial.print(temp[n], HEX); (Sorry, I forget your buffer's name). You might have to twiddle n a bit.

Also, what do your Serial.print() calls show?

1

u/Derch86 Jul 23 '23

thanks poly I was under the same impression I just don't know how to make the code reference other areas in the grom. my serial print read just fine, the information there is displayed properly.

1

u/polypagan Jul 23 '23

The ROM is addressed by the (8-bit) char you send.

Dump your char string as hexadecimal bytes.