Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:17 25 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MM LCD

Author Message
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1873
Posted: 10:50pm 04 Feb 2012
Copy link to clipboard 
Print this post

Got my display working OK but just have a couple of queries. When editing the program I included print statements of the strings sent to the LCD so I could see on the monitor what was happening. When all was working OK I removed the print statements only to find the LCD then displayed garbage. I included the print statements again and all was ok. Why is this. Also when editing a program that runs in an endless loop like this one (a temperature, humidity and dewpoint meter) is there a way to stop the program executing to do editing without having to turn off the Maximite and then reload the program.
This is the offending code:-
L001: GoSub L002
For x = 1 To 2 ' Initialise the LCD
Print Temp$
Print Hum$
Print Dew$
Print Comf$
If x=1 Then LCD_line1$ = Temp$:EndIf
If x=1 Then LCD_line2$ = Hum$:EndIf
If x=2 Then LCD_line1$ = Dew$:EndIf
If x=2 Then LCD_line2$ = Comf$
GoSub L003 ' send to the LCD
Pause 3000
Next x
GoTo L001

Without the print statements it wont work.
Paul.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 10:56pm 04 Feb 2012
Copy link to clipboard 
Print this post

To stop running program type Ctrl "C"

The other problem sounds like a timing issue
try a Pause 100 before the Gosub L003 statement.
Without the rest of the code I get be totally sure.

VK4MU MicroController Units

 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1873
Posted: 04:17am 05 Feb 2012
Copy link to clipboard 
Print this post

OK the 'pause 100' works OK, don't know why. If I send the message to the LCD in ""....." it works ok but if I put the text in a string variable I need the pause.
Thanks for all the help
Paul.
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 04:58am 05 Feb 2012
Copy link to clipboard 
Print this post

It is due to the timing needed for the LCD module.
Time spent processing a string Variable (Temp$) and a String constant("Temperature" ) differ.
[Quote=What was I thinking]I get be totally sure[/quote]
Edited by djuqa 2012-02-06
VK4MU MicroController Units

 
palcal

Guru

Joined: 12/10/2011
Location: Australia
Posts: 1873
Posted: 03:21am 06 Feb 2012
Copy link to clipboard 
Print this post

Thanks for the info.
Paul
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024