Hi, juan
you just send your message to the LCD ... IF there is a change for button position ...
Alain
Hi, juan
you just send your message to the LCD ... IF there is a change for button position ...
Alain
Since it's your first post...
BUT more than often PORTA contain some analog stuff... SEROUT may work properly or not. Look for CMCON or ADCON1 to see how to disable themCode:Include "modedefs.bas" ' Include serial modes TRISA = %00000000 ' All the PORTA pins to outputs. TRISB = %11111111 ' All the PORTB pins to inputs. I con 254 '254h = 1111 1110 (Sets LCD to command mode) ClrScr con 1 '01h = 0000 00001 (Clears Screen & goes to position 1) Line2 con $C0 'COh = 1100 0000B (sets address to positionn 40 on LCD) DispCur con 12 '12h = 0000 1100 (activates display & cursor mode) 'Commands obtained from LCD article in epemag.com pause 400 ' Allow LCD to boot up Start: serout PORTA.1,T9600,[I,clrscr] pause 100 Serout PORTA.1,T9600,["Press Button"] while PORTB.2=0 ' Wait untill push-button is pressed wend serout PORTA.1,T9600,[I,clrscr] pause 100 SEROUT PORTA.1,T9600,["Button Pressed!"] ' Indicate Button Pressed pause 1000 ' delay 1 sec goto start
Your Define BUTTON will not do anything if you don't use BUTTON command.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Just 3 lines to add between PAUSE 1000 and goto start ( at the end ...) in case you keep the finger on the pressed button ...
while PORTB.2=1
' Wait until push-button is released
wend
Alain
Last edited by Acetronics2; - 4th August 2005 at 14:45.
Only do a clr screen at the beginning of your program. before your loop.
Send a command to position curser at the beginning of the LCD line. in your loop
granted it will be overwriting what is already there, but who cares?
Dwayne
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Lovely, thanks fellas, much appreciated. I got picBasic a few weeks ago and I havent stopped playing what I call "lego for adults" since. Hope I can be as good as you guys one day.
Much appreciated!
:-)
Juan
Bookmarks