Converting to ASCII for a Parallel PCD panel for BS2?
I am experimenting with a LCD panel and want to use it like a simple
digital thermometer.
I want to take a number and convert and output it to a LCD panel using
a BS2 Basic Stamp, the BS2 doesn't have a LCDcmd function.
if I have a word variable that is holding a value, how can I
convert that so it can be outputted to the LCD panel?
For example:
'{$STAMP BS2}
x var word
x = 1236
debug dec x
end
This displays 1236 out the serial port, but how would I show it on
a LCD panel?
Thanks
digital thermometer.
I want to take a number and convert and output it to a LCD panel using
a BS2 Basic Stamp, the BS2 doesn't have a LCDcmd function.
if I have a word variable that is holding a value, how can I
convert that so it can be outputted to the LCD panel?
For example:
'{$STAMP BS2}
x var word
x = 1236
debug dec x
end
This displays 1236 out the serial port, but how would I show it on
a LCD panel?
Thanks
Comments
When I have to display numbers, I use an array of characters.
text VAR byte(16)
Then, I prepare the text :
for i=0 to 15
lookup i,[noparse][[/noparse]"Temperature : "],text(i)
next
Finaly, if 'TEMP' is the variable containing the temperature, I use the DIG
function :
text(13)=48+(temp dig 1)
text(14)=48+(temp dig 0)
48 is the ASCII code of '0'. So if the temperature is 25, you get 50 and 53,
which are the codes for '2' and '5'
You just have to send the text array to the display (depending on the model
you have, serial / parallel)
Hope this helps...
Best regards,
Phil.
Original Message
From: <earlwb@w...>
To: <basicstamps@yahoogroups.com>
Sent: Saturday, November 24, 2001 5:34 PM
Subject: [noparse][[/noparse]basicstamps] Converting to ASCII for a Parallel PCD panel for BS2?
> I am experimenting with a LCD panel and want to use it like a simple
> digital thermometer.
> I want to take a number and convert and output it to a LCD panel using
> a BS2 Basic Stamp, the BS2 doesn't have a LCDcmd function.
>
> if I have a word variable that is holding a value, how can I
> convert that so it can be outputted to the LCD panel?
>
> For example:
> '{$STAMP BS2}
> x var word
> x = 1236
> debug dec x
> end
>
> This displays 1236 out the serial port, but how would I show it on
> a LCD panel?
>
> 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/
>
>
>
I went through the manual several times and never saw it.
In regular basic (VB for example) you have CHR, ASC, VAL, et cetera,
I just never thought about the DIG function.
Thanks again, I appreciate it.
--- In basicstamps@y..., "Philippe Derenne" <derennep@s...> wrote:
> Hi,
>
> When I have to display numbers, I use an array of characters.
>
> text VAR byte(16)
>
> Then, I prepare the text :
>
> for i=0 to 15
> lookup i,[noparse][[/noparse]"Temperature : "],text(i)
> next
>
> Finaly, if 'TEMP' is the variable containing the temperature, I
use the DIG
> function :
>
> text(13)=48+(temp dig 1)
> text(14)=48+(temp dig 0)
>
> 48 is the ASCII code of '0'. So if the temperature is 25, you get
50 and 53,
> which are the codes for '2' and '5'
>
> You just have to send the text array to the display (depending on
the model
> you have, serial / parallel)
>
> Hope this helps...
>
> Best regards,
>
> Phil.
>
>
>
>
Original Message
> From: <earlwb@w...>
> To: <basicstamps@y...>
> Sent: Saturday, November 24, 2001 5:34 PM
> Subject: [noparse][[/noparse]basicstamps] Converting to ASCII for a Parallel PCD panel
for BS2?
>
>
> > I am experimenting with a LCD panel and want to use it like a
simple
> > digital thermometer.
> > I want to take a number and convert and output it to a LCD panel
using
> > a BS2 Basic Stamp, the BS2 doesn't have a LCDcmd function.
> >
> > if I have a word variable that is holding a value, how can I
> > convert that so it can be outputted to the LCD panel?
> >
> > For example:
> > '{$STAMP BS2}
> > x var word
> > x = 1236
> > debug dec x
> > end
> >
> > This displays 1236 out the serial port, but how would I show it on
> > a LCD panel?
> >
> > Thanks
> >
> >
> >
> > To UNSUBSCRIBE, just send mail to:
> > basicstamps-unsubscribe@y...
> > 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/
> >
> >
> >