
Originally Posted by
mister_e
try something like that
Code:
DEFINE OSC 40
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 64
Start:
Hserout ["Program has started.",13,10]
gosub LookForStart
Goto Start
LookForStart:
HSERIN 5000,noData,[WAIT ("start")]
hserout ["Got it! Backlight ON",13,10]
Return
nodata:
HSEROUT ["NOPE... Life's so cruel...",13,10]
Return
Thanks!
HSERIN command remind me the BUTTON command (with the label).
So I use this :
Code:
DEFINE OSC 40
DEFINE LCD_DREG PORTD
DEFINE LCD_EREG PORTB
DEFINE LCD_RSREG PORTB
DEFINE LCD_EBIT 6
DEFINE LCD_RSBIT 7
DEFINE ADC_BITS 10
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 64
Hserout ["Varidrive V2011.00 has started"]
mainlp:
LCDOUT $fe,2,"Main loop"
HSERIN ret,[WAIT ("blon")]
HIGH PORTD.4
ret:
HSERIN ret1,[WAIT ("bloff")]
LOW PORTD.4
ret1:
Goto mainlp
And it works flawlessly.
However, when I type "blonn" instead of "blon", the backlight is activated.
Same thing with "blofffff" instead off "bloff", the backlight is disabled.
So I need a stop bit or something like that?
Bookmarks