Shop OBEX P1 Docs P2 Docs Learn Events
BS2 Interface to Amulet Easy GUI 5.7 — Parallax Forums

BS2 Interface to Amulet Easy GUI 5.7

ArchiverArchiver Posts: 46,084
edited 2003-07-29 21:19 in General Discussion
I've been helping out a fellow Stamper with his serial interface to
an Amulet Easy GUI 5.7" Starter Kit and I thought that some of you
may benefit from our discusstions.

Initial Problem:

I'm interfacing an Amulet display with a Basic Stamp 2. I have just
started to understand how everything works but have run into a
problem. I made a simple HTML page with a numeric field widget in the
middle that sends the get byte function out to my Basic Stamp. The
Stamp just replies with the value of the variable. Simple enough.
However, the numeric field won't update.

The End Result:

I had a simple HTML page with a numeric field widget in the middle
sending a get byte command out to my Basic Stamp. It was asking for
byte variable 01 so the Amulet sent:

0xD0 0x30 0x31 0x00 (with the null at the end because of the
BASICStamp meta tag)

my code to receive this was:

serin 16, 84, [noparse][[/noparse]STR serstring\9\"0"]

with the \"0" hopefully meaning it would stop when it saw the null
termination character. However, it was actually looking for the ascii
char "0" (decimal value 48) and not the null character 0 (decimal
value 0).

So when I changed my code to:

serin 16, 84, [noparse][[/noparse]STR serstring\9\0]

everything worked.

Ed
Sign In or Register to comment.