Byte value to ASCII
Archiver
Posts: 46,084
Hello,
I'm working on a project to display a temperature value (with temp.
sensor DS1624) on a LCD (4-bit mode, hitachi compatible).
The problem I experienced is displaying the temperature value on the
LCD, because I don't know how to convert a binairy value to a string
value (a string value is needed to send to the LCD)
example:
value = %00010011 ( = 19)
howto convert %00010011 to characters "1" and "9" with a minimum of
code?
Thanks
I'm working on a project to display a temperature value (with temp.
sensor DS1624) on a LCD (4-bit mode, hitachi compatible).
The problem I experienced is displaying the temperature value on the
LCD, because I don't know how to convert a binairy value to a string
value (a string value is needed to send to the LCD)
example:
value = %00010011 ( = 19)
howto convert %00010011 to characters "1" and "9" with a minimum of
code?
Thanks
Comments
For BS2:
LcdBusOut = %0001
PULSOUT E, 3 : PAUSE 5
LcdBusOut = %0011
PULSOUT E, 3
For BS2p:
LCDCMD E, %00010011 : PAUSE 5
might want to look at the LCD Appmod code in AppNote #29121 for more
details.
http://www.parallax.com/dl/docs/prod/appmod/lcd%20terminal.pdf
Dave.
Original Message
From: timvlaer [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=cdlIgiqxYGm8N8aZF7exo4hnkMbd71SHginLxhkXHDUzDSzKDgn292Kc5i3Mz3EE79kmsLbR]stevie77@m...[/url
Sent: Tuesday, September 30, 2003 3:08 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Byte value to ASCII
Hello,
I'm working on a project to display a temperature value (with temp.
sensor DS1624) on a LCD (4-bit mode, hitachi compatible).
The problem I experienced is displaying the temperature value on the
LCD, because I don't know how to convert a binairy value to a string
value (a string value is needed to send to the LCD)
example:
value = %00010011 ( = 19)
howto convert %00010011 to characters "1" and "9" with a minimum of
code?
Thanks
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.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
information even if you are programming to the BS2.
Dave.
Original Message
From: Dave Waddell [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=BsYvW-AcemdX8uTwjbMVSfwZ5QwW-MoyVONyPRYKf_N0wXUMKyxTKpFrBYLJfIojaOAKQ9WFSTE]waddell@p...[/url
Sent: Tuesday, September 30, 2003 3:52 AM
To: basicstamps@yahoogroups.com
Subject: RE: [noparse][[/noparse]basicstamps] Byte value to ASCII
You can send this directly:
For BS2:
LcdBusOut = %0001
PULSOUT E, 3 : PAUSE 5
LcdBusOut = %0011
PULSOUT E, 3
For BS2p:
LCDCMD E, %00010011 : PAUSE 5
might want to look at the LCD Appmod code in AppNote #29121 for more
details.
http://www.parallax.com/dl/docs/prod/appmod/lcd%20terminal.pdf
Dave.
Original Message
From: timvlaer [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Am39WDPGofWkaJ6l5CDdfcdpJLKgFHkDEWvu5sLheuEB9422VAXwkls82wWtEt4q6m1iW1BNyPjV]stevie77@m...[/url
Sent: Tuesday, September 30, 2003 3:08 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Byte value to ASCII
Hello,
I'm working on a project to display a temperature value (with temp.
sensor DS1624) on a LCD (4-bit mode, hitachi compatible).
The problem I experienced is displaying the temperature value on the
LCD, because I don't know how to convert a binairy value to a string
value (a string value is needed to send to the LCD)
example:
value = %00010011 ( = 19)
howto convert %00010011 to characters "1" and "9" with a minimum of
code?
Thanks
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.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
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.
Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
HiVal VAR BYTE
LowVal VAR BYTE
Value = %00010011
HiVal = Value/10
LowVal = Value - (HighVal * 10)
' At this point, HiVal = 1, LowVal = 9
' It depends onr you LCD character set
' what offset (if any) you need to add
' before you send each character to it.
--- In basicstamps@yahoogroups.com, "timvlaer" <stevie77@m...> wrote:
> Hello,
>
> I'm working on a project to display a temperature value (with temp.
> sensor DS1624) on a LCD (4-bit mode, hitachi compatible).
>
> The problem I experienced is displaying the temperature value on
the
> LCD, because I don't know how to convert a binairy value to a
string
> value (a string value is needed to send to the LCD)
>
> example:
>
> value = %00010011 ( = 19)
>
> howto convert %00010011 to characters "1" and "9" with a minimum of
> code?
>
>
> Thanks
value = 19 ' %00010011
debug (value dig 1 + 48) ' ascii 49 = "1"
debug (value dig 0 + 48) ' ascii 57 = "9"
-- Tracy
>Hello,
>
>I'm working on a project to display a temperature value (with temp.
>sensor DS1624) on a LCD (4-bit mode, hitachi compatible).
>
>The problem I experienced is displaying the temperature value on the
>LCD, because I don't know how to convert a binairy value to a string
>value (a string value is needed to send to the LCD)
>
>example:
>
>value = %00010011 ( = 19)
>
>howto convert %00010011 to characters "1" and "9" with a minimum of
>code?
>
>Thanks
of code!
--- In basicstamps@yahoogroups.com, Tracy Allen <tracy@e...> wrote:
> Look up the DIG operator in your HELP file or in your manual:
>
> value = 19 ' %00010011
> debug (value dig 1 + 48) ' ascii 49 = "1"
> debug (value dig 0 + 48) ' ascii 57 = "9"
>
> -- Tracy
>
>
> >Hello,
> >
> >I'm working on a project to display a temperature value (with temp.
> >sensor DS1624) on a LCD (4-bit mode, hitachi compatible).
> >
> >The problem I experienced is displaying the temperature value on
the
> >LCD, because I don't know how to convert a binairy value to a
string
> >value (a string value is needed to send to the LCD)
> >
> >example:
> >
> >value = %00010011 ( = 19)
> >
> >howto convert %00010011 to characters "1" and "9" with a minimum of
> >code?
> >
> >Thanks