Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp II (Ver 1.0) Combining LCD Display w/SHT1x code — Parallax Forums

Basic Stamp II (Ver 1.0) Combining LCD Display w/SHT1x code

ArchiverArchiver Posts: 46,084
edited 2003-07-07 16:38 in General Discussion
MessageOK Jon:
I had realized what the DIG would do about 4 AM this morning when I couldn't
sleep! Ha! Anyway I can see how much easier it is than that other code (I will
have to figure that out). Also, thanks for the suggestions on reading material,
I'll be sure to get those two items you mentioned. By the way, I am also a
temperature "nut", but even more important is the humidity! I live in FL, and
the humidity has an even more effect on how one "feels" than the temperature;
i.e. 78 degrees feels pretty good at 50%, but at 60% it feels hot and sticky.
It is also very difficult to buy an "accurate" humidity gauge, hence my
excitement over the SHT1x (which I just lately found out about because my
subscription to Poptronics was changed over to Nuts and Volts)
Kindest regards,
Chuck Irwin

Original Message
From: Jon Williams
To: chuckirwin43
Sent: Monday, July 07, 2003 9:42 AM
Subject: RE: Basic Stamp II (Ver 1.0) Combining LCD Display w/SHT1x code


Well, Chuck, I'll offer as much help as time permits -- but will ask that you
keep these contacts on the BASIC Stamp list [noparse][[/noparse]where they started] so that
everyone can benefit from the conversation.

Okay, why did I suggest DIG? Because you can only send one character at a
time to the LCD. By using the DIG operator, you avoid a bunch of math. Let's
say you want to send a 3-digit value to the display. Here's the hard way:

Send_Number:
char = temp / 100 + "0"
GOSUB LCD_Write
char = (temp // 100) / 10 + "0"
GOSUB LCD_Write
char = (temp // 10) + "0"
GOSUB LCD_Write
RETURN

I'm not going to explain this; you can look things up in the manual and figure
it out -- it will stick with you that way. Now, here's an easier way to do the
same thing with DIG:

Send_Number:
FOR idx = 2 TO 0
char = (myNumber DIG idx) + "0"
GOSUB LCD_Write
NEXT
RETURN

You can untie your arms from your legs by using some of the free training
materials available for download from our web site -- including my book,
StampWorks. There are others too, like "What's a Microcontroller." Spend a
little time learning the fundamentals and you'll save yourself a lot of
frustration.

-- Jon Williams
-- Parallax
Original Message
From: chuckirwin43 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=nn9fW6MZCVify7YAfkIuojR25TLKZuk9ghIJPqOn089Z71gTKttk1YrUCVq1fqKN2VwoNPZy3KIIRovN6UAM0ccg]chuckirwin43@n...[/url
Sent: Sunday, July 06, 2003 4:25 PM
To: Jon Williams
Subject: Basic Stamp II (Ver 1.0) Combining LCD Display w/SHT1x code


Hello Jon:
Thanks very much for your help and advice. I will use the adding of the
"0", which I DID NOT KNOW! I am also looking at the description of "DIG" in
the PBASIC Syntax Guide and see that it returns any digit of a number.......why
do I need that? OK, as you can see, a first time user of the Stamp, and never
doing any kind of program, I am trying to run a race with my arms tied to my
legs. You may not want to put up with such a "beginner" as I am.
Kindest regards,
Chuck Irwin


Keep in mind that if you're going to use a parallel LCD and are NOT
using a BS2p/BS2pe, you will have to send just one character at a time.
Get familiar with the DIG operator -- this will come in handy. Also
remember that you have to send ASCII codes to the display. Adding 48
("0") to a digit value will convert that digit to its ASCII code.

-- Jon Williams
-- Parallax



This message has been scanned by WebShield. Please report SPAM to
abuse@p....


[noparse][[/noparse]Non-text portions of this message have been removed]

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-07-07 16:38
    I'll second John's motion! Thats kind of what I was getting at when
    I suggested the parallax documentation.

    I know exactly what its like to just start out - wasn't all that
    long ago that I was wanting to make my stamp run the space shuttle
    when I didn't have the foggiest idea how the thing worked [noparse]:D[/noparse]

    Best thing is to learn to walk before you fly. After the initial pie-
    in-the-sky phase, I bought the earth measurements kit and did all
    its experiments. Then I purchased Al Williams' book (Microcontroller
    projects using the basic stamp) and went though all his examples
    (including the parallel LCD!). After that I stuck out on my own
    (well, with lots of stamp-list help) and started doing my own things.

    The parallax documentation is great and I can't stress enough how
    much it will help you to go through all the experiments, whether you
    expect to use the particular circuits or not.

    Start small and work your way up.

    > You can untie your arms from your legs by using some of the free
    training materials available for download from our web site --
    including my book, StampWorks. There are others too, like "What's a
    Microcontroller." Spend a little time learning the fundamentals and
    you'll save yourself a lot of frustration.
    >
    > -- Jon Williams
    > -- Parallax
    this message have been removed]
Sign In or Register to comment.