LCD dispplay on BS2
Archiver
Posts: 46,084
Hi everybody,
I have a 2 x 8 LCD display working on my BS2.
It displays the sample line "Hallo-hallo !!". (see (modified) code
fragments from Jon Williams below)
But now I want to display a value from my program to the display. In
the DEBUG this value is diplayd as follows:
DEBUG CLS, DEC Ts/10, ".", DEC1 Ts
How can I put this to my LCD display?
Many thanks in advance,
Klaus
LOW RW
OUTH = %00000000
DIRH = %11111111
DATA "Hallo-hallo !!"
GOSUB INITLCD
FOR TEMP = 0 TO 13
IF TEMP = 6 THEN NEXT_LINE
OUT:
READ TEMP, CHAR
GOSUB SENDTEXT
NEXT
STOP
SENDTEXT:
HIGH RS
OUTD=CHAR.HIGHNIB
PULSOUT E,1
PAUSE 5
OUTD=CHAR.LOWNIB
PULSOUT E,1
PAUSE 100
I have a 2 x 8 LCD display working on my BS2.
It displays the sample line "Hallo-hallo !!". (see (modified) code
fragments from Jon Williams below)
But now I want to display a value from my program to the display. In
the DEBUG this value is diplayd as follows:
DEBUG CLS, DEC Ts/10, ".", DEC1 Ts
How can I put this to my LCD display?
Many thanks in advance,
Klaus
LOW RW
OUTH = %00000000
DIRH = %11111111
DATA "Hallo-hallo !!"
GOSUB INITLCD
FOR TEMP = 0 TO 13
IF TEMP = 6 THEN NEXT_LINE
OUT:
READ TEMP, CHAR
GOSUB SENDTEXT
NEXT
STOP
SENDTEXT:
HIGH RS
OUTD=CHAR.HIGHNIB
PULSOUT E,1
PAUSE 5
OUTD=CHAR.LOWNIB
PULSOUT E,1
PAUSE 100
Comments
klausdejong@x... writes:
> DEBUG CLS, DEC Ts/10, ".", DEC1 Ts
>
> How can I put this to my LCD display?
>
>
Write to the LCD just like you were writing to Debug, with the proper LCD
commands, of course.
Sid Weaver
W4EKQ
Port Richey, FL
[noparse][[/noparse]Non-text portions of this message have been removed]
code that will work for you -- I tested with DEBUG but I am confident
will work with your LCD code.
Main:
LOOKDOWN ts, <=[noparse][[/noparse]9, 99, 999, 9999, $FFFF], mDig
IF (mDig = 0) THEN ' ts is less than 10
char = "0" ' put 0 in ones position
GOSUB Write_LCD
ELSE
FOR idx = mDig TO 1 ' loop through whole digits
char = ts DIG idx + 48 ' get digit; convert to ASCII
GOSUB Write_LCD
NEXT
ENDIF
char = "." ' decimal point
GOSUB Write_LCD
char = ts DIG 0 + 48 ' tenths digit
GOSUB Write_LCD
END
This goes to show that the formatting operators like DEC, HEX and BIN do
a lot of work for us. If you want to simplify and don't mind
zero-padded values, you can do it like this:
Main:
FOR idx = 4 TO 1
char = ts DIG idx + 48
GOSUB Write_LCD
NEXT
char = "."
GOSUB Write_LCD
char = ts DIG 0 + 48
GOSUB Write_LCD
END
-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office
Original Message
From: klausdejong [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=vMP-yLGzR4d7LWcm98Rqb0aAgs0KmNuKJ2_fcRXNtF3OeLjLKlYe3RZerj75Ccfn_8TmDuYQTlzUorK0Ug]klausdejong@x...[/url
Sent: Friday, December 19, 2003 10:09 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] LCD dispplay on BS2
Hi everybody,
I have a 2 x 8 LCD display working on my BS2.
It displays the sample line "Hallo-hallo !!". (see (modified) code
fragments from Jon Williams below)
But now I want to display a value from my program to the display. In
the DEBUG this value is diplayd as follows:
DEBUG CLS, DEC Ts/10, ".", DEC1 Ts
How can I put this to my LCD display?
Many thanks in advance,
Klaus
LOW RW
OUTH = %00000000
DIRH = %11111111
DATA "Hallo-hallo !!"
GOSUB INITLCD
FOR TEMP = 0 TO 13
IF TEMP = 6 THEN NEXT_LINE
OUT:
READ TEMP, CHAR
GOSUB SENDTEXT
NEXT
STOP
SENDTEXT:
HIGH RS
OUTD=CHAR.HIGHNIB
PULSOUT E,1
PAUSE 5
OUTD=CHAR.LOWNIB
PULSOUT E,1
PAUSE 100
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/basicstamps/
To unsubscribe from this group, send an email to:
basicstamps-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
I use the simple version of your code and it works fine for me.
Now I can go on with my little project and finish it hopefully before
christmas. That is the deadline my wife has put on this tiny wine
thermometer project :-))))))))))).
Regards,
Klaus de Jong
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> You'll have to write your number a character at a time. Here's a
bit of
> code that will work for you -- I tested with DEBUG but I am
confident
> will work with your LCD code.
>
>
> Main:
> LOOKDOWN ts, <=[noparse][[/noparse]9, 99, 999, 9999, $FFFF], mDig
>
> IF (mDig = 0) THEN ' ts is less than 10
> char = "0" ' put 0 in ones position
> GOSUB Write_LCD
> ELSE
> FOR idx = mDig TO 1 ' loop through whole digits
> char = ts DIG idx + 48 ' get digit; convert to
ASCII
> GOSUB Write_LCD
> NEXT
> ENDIF
> char = "." ' decimal point
> GOSUB Write_LCD
> char = ts DIG 0 + 48 ' tenths digit
> GOSUB Write_LCD
>
> END
>
>
> This goes to show that the formatting operators like DEC, HEX and
BIN do
> a lot of work for us. If you want to simplify and don't mind
> zero-padded values, you can do it like this:
>
>
> Main:
> FOR idx = 4 TO 1
> char = ts DIG idx + 48
> GOSUB Write_LCD
> NEXT
> char = "."
> GOSUB Write_LCD
> char = ts DIG 0 + 48
> GOSUB Write_LCD
>
> END
>
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
>
Original Message
> From: klausdejong [noparse][[/noparse]mailto:klausdejong@x...]
> Sent: Friday, December 19, 2003 10:09 AM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] LCD dispplay on BS2
>
>
> Hi everybody,
>
> I have a 2 x 8 LCD display working on my BS2.
>
> It displays the sample line "Hallo-hallo !!". (see (modified) code
> fragments from Jon Williams below)
>
> But now I want to display a value from my program to the display.
In
> the DEBUG this value is diplayd as follows:
>
> DEBUG CLS, DEC Ts/10, ".", DEC1 Ts
>
> How can I put this to my LCD display?
>
> Many thanks in advance,
>
> Klaus
>
> LOW RW
> OUTH = %00000000
> DIRH = %11111111
> DATA "Hallo-hallo !!"
> GOSUB INITLCD
>
> FOR TEMP = 0 TO 13
> IF TEMP = 6 THEN NEXT_LINE
>
> OUT:
>
> READ TEMP, CHAR
>
> GOSUB SENDTEXT
>
> NEXT
>
> STOP
>
> SENDTEXT:
> HIGH RS
> OUTD=CHAR.HIGHNIB
> PULSOUT E,1
> PAUSE 5
> OUTD=CHAR.LOWNIB
> PULSOUT E,1
> PAUSE 100
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject
> and Body of the message will be ignored.
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/basicstamps/
>
> To unsubscribe from this group, send an email to:
> basicstamps-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
Utrecht to conduct classes) -- perhaps I could sample some of that wine
you're monitoring?....
Happy Holidays.
-- Jon Williams
-- Parallax
Original Message
From: klausdejong [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=-B3acr2qtbxtEE8LdQM7ZK3IiaRz3Xzj9eQA4RJH8eyaasFH0_hpExmIvsNhc44lv8Akw-WKY9JscmvSS_s02A]klausdejong@x...[/url
Sent: Friday, December 19, 2003 12:17 PM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: LCD dispplay on BS2
Thanks Jon!
I use the simple version of your code and it works fine for me.
Now I can go on with my little project and finish it hopefully before
christmas. That is the deadline my wife has put on this tiny wine
thermometer project :-))))))))))).
Regards,
Klaus de Jong
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> You'll have to write your number a character at a time. Here's a
bit of
> code that will work for you -- I tested with DEBUG but I am
confident
> will work with your LCD code.
>
>
> Main:
> LOOKDOWN ts, <=[noparse][[/noparse]9, 99, 999, 9999, $FFFF], mDig
>
> IF (mDig = 0) THEN ' ts is less than 10
> char = "0" ' put 0 in ones position
> GOSUB Write_LCD
> ELSE
> FOR idx = mDig TO 1 ' loop through whole digits
> char = ts DIG idx + 48 ' get digit; convert to
ASCII
> GOSUB Write_LCD
> NEXT
> ENDIF
> char = "." ' decimal point
> GOSUB Write_LCD
> char = ts DIG 0 + 48 ' tenths digit
> GOSUB Write_LCD
>
> END
>
>
> This goes to show that the formatting operators like DEC, HEX and
BIN do
> a lot of work for us. If you want to simplify and don't mind
> zero-padded values, you can do it like this:
>
>
> Main:
> FOR idx = 4 TO 1
> char = ts DIG idx + 48
> GOSUB Write_LCD
> NEXT
> char = "."
> GOSUB Write_LCD
> char = ts DIG 0 + 48
> GOSUB Write_LCD
>
> END
>
>
> -- Jon Williams
> -- Applications Engineer, Parallax
> -- Dallas Office
>
>
>
>
Original Message
> From: klausdejong [noparse][[/noparse]mailto:klausdejong@x...]
> Sent: Friday, December 19, 2003 10:09 AM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] LCD dispplay on BS2
>
>
> Hi everybody,
>
> I have a 2 x 8 LCD display working on my BS2.
>
> It displays the sample line "Hallo-hallo !!". (see (modified) code
> fragments from Jon Williams below)
>
> But now I want to display a value from my program to the display.
In
> the DEBUG this value is diplayd as follows:
>
> DEBUG CLS, DEC Ts/10, ".", DEC1 Ts
>
> How can I put this to my LCD display?
>
> Many thanks in advance,
>
> Klaus
>
> LOW RW
> OUTH = %00000000
> DIRH = %11111111
> DATA "Hallo-hallo !!"
> GOSUB INITLCD
>
> FOR TEMP = 0 TO 13
> IF TEMP = 6 THEN NEXT_LINE
>
> OUT:
>
> READ TEMP, CHAR
>
> GOSUB SENDTEXT
>
> NEXT
>
> STOP
>
> SENDTEXT:
> HIGH RS
> OUTD=CHAR.HIGHNIB
> PULSOUT E,1
> PAUSE 5
> OUTD=CHAR.LOWNIB
> PULSOUT E,1
> PAUSE 100
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject
> and Body of the message will be ignored.
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/basicstamps/
>
> To unsubscribe from this group, send an email to:
> basicstamps-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Yahoo! Groups Links
To visit your group on the web, go to:
http://groups.yahoo.com/group/basicstamps/
To unsubscribe from this group, send an email to:
basicstamps-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
This message has been scanned by WebShield. Please report SPAM to
abuse@p....
project by drinking a good glas of wine. We have normally a good red
Cotes du Rhone and an even better white Pinot Blanc in stock.
We live near Leiden and the Hague which is about 75 km's from
Utrecht. In fact I visit Utrecht regularly for work.
So let's keep in touch.
Regards,
Klaus
--- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
wrote:
> You're welcome. I'll be in Holland next year (March, I think, in
> Utrecht to conduct classes) -- perhaps I could sample some of that
wine
> you're monitoring?....
>
> Happy Holidays.
>
> -- Jon Williams
> -- Parallax
>
>
>
Original Message
> From: klausdejong [noparse][[/noparse]mailto:klausdejong@x...]
> Sent: Friday, December 19, 2003 12:17 PM
> To: basicstamps@yahoogroups.com
> Subject: [noparse][[/noparse]basicstamps] Re: LCD dispplay on BS2
>
>
> Thanks Jon!
>
> I use the simple version of your code and it works fine for me.
>
> Now I can go on with my little project and finish it hopefully
before
> christmas. That is the deadline my wife has put on this tiny wine
> thermometer project :-))))))))))).
>
> Regards,
>
> Klaus de Jong
>
> --- In basicstamps@yahoogroups.com, "Jon Williams" <jwilliams@p...>
> wrote:
> > You'll have to write your number a character at a time. Here's a
> bit of
> > code that will work for you -- I tested with DEBUG but I am
> confident
> > will work with your LCD code.
> >
> >
> > Main:
> > LOOKDOWN ts, <=[noparse][[/noparse]9, 99, 999, 9999, $FFFF], mDig
> >
> > IF (mDig = 0) THEN ' ts is less than 10
> > char = "0" ' put 0 in ones position
> > GOSUB Write_LCD
> > ELSE
> > FOR idx = mDig TO 1 ' loop through whole
digits
> > char = ts DIG idx + 48 ' get digit; convert to
> ASCII
> > GOSUB Write_LCD
> > NEXT
> > ENDIF
> > char = "." ' decimal point
> > GOSUB Write_LCD
> > char = ts DIG 0 + 48 ' tenths digit
> > GOSUB Write_LCD
> >
> > END
> >
> >
> > This goes to show that the formatting operators like DEC, HEX and
> BIN do
> > a lot of work for us. If you want to simplify and don't mind
> > zero-padded values, you can do it like this:
> >
> >
> > Main:
> > FOR idx = 4 TO 1
> > char = ts DIG idx + 48
> > GOSUB Write_LCD
> > NEXT
> > char = "."
> > GOSUB Write_LCD
> > char = ts DIG 0 + 48
> > GOSUB Write_LCD
> >
> > END
> >
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
> >
Original Message
> > From: klausdejong [noparse][[/noparse]mailto:klausdejong@x]
> > Sent: Friday, December 19, 2003 10:09 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] LCD dispplay on BS2
> >
> >
> > Hi everybody,
> >
> > I have a 2 x 8 LCD display working on my BS2.
> >
> > It displays the sample line "Hallo-hallo !!". (see (modified) code
> > fragments from Jon Williams below)
> >
> > But now I want to display a value from my program to the display.
> In
> > the DEBUG this value is diplayd as follows:
> >
> > DEBUG CLS, DEC Ts/10, ".", DEC1 Ts
> >
> > How can I put this to my LCD display?
> >
> > Many thanks in advance,
> >
> > Klaus
> >
> > LOW RW
> > OUTH = %00000000
> > DIRH = %11111111
> > DATA "Hallo-hallo !!"
> > GOSUB INITLCD
> >
> > FOR TEMP = 0 TO 13
> > IF TEMP = 6 THEN NEXT_LINE
> >
> > OUT:
> >
> > READ TEMP, CHAR
> >
> > GOSUB SENDTEXT
> >
> > NEXT
> >
> > STOP
> >
> > SENDTEXT:
> > HIGH RS
> > OUTD=CHAR.HIGHNIB
> > PULSOUT E,1
> > PAUSE 5
> > OUTD=CHAR.LOWNIB
> > PULSOUT E,1
> > PAUSE 100
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@yahoogroups.com
> > from the same email address that you subscribed. Text in the
> Subject
> > and Body of the message will be ignored.
> >
> >
> > Yahoo! Groups Links
> >
> > To visit your group on the web, go to:
> > http://groups.yahoo.com/group/basicstamps/
> >
> > To unsubscribe from this group, send an email to:
> > basicstamps-unsubscribe@yahoogroups.com
> >
> > Your use of Yahoo! Groups is subject to:
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please report SPAM to
> > abuse@p...
>
>
> To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
> from the same email address that you subscribed. Text in the
Subject
> and Body of the message will be ignored.
>
>
> Yahoo! Groups Links
>
> To visit your group on the web, go to:
> http://groups.yahoo.com/group/basicstamps/
>
> To unsubscribe from this group, send an email to:
> basicstamps-unsubscribe@yahoogroups.com
>
> Your use of Yahoo! Groups is subject to:
> http://docs.yahoo.com/info/terms/
>
>
>
>
> This message has been scanned by WebShield. Please report SPAM to
> abuse@p...