27220 Parallax Inc, 27220 Datasheet - Page 214

BOOK STAMPWORKS

27220

Manufacturer Part Number
27220
Description
BOOK STAMPWORKS
Manufacturer
Parallax Inc
Datasheet

Specifications of 27220

Accessory Type
Booklet
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
StampWorks
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Not applicable / Not applicable
Page 204 · StampWorks
The first command is "?F1" which will allow us to write a string value to the BASIC
Stamp’s EEPROM (in a location called ID). When $F1 is received as a command
value, the program jumps to the subroutine called Set_ID. On entry to Set_ID, the
eeAddr
EE pointer called
is initialized, and then the BASIC Stamp waits for a
character to arrive. Notice that no modifier is used here. Since terminal programs
and the BASIC Stamp represent characters using ASCII codes, we don’t have to do
anything special. When a character does arrive, WRITE is used to put the character
into EEPROM and the address pointer is incremented. If the last character was a
carriage return (13), the program displays the new string (using the code at
Show_ID), otherwise it loops back and waits for another character.
The second modifying query is “?B1” which allows us to set the status of four LEDs.
Take a look at the subroutine called Set_Leds. This time, the BIN modifier of
SERIN is used so that we can easily define individual bits we wish to control. By
using the BIN modifier, our input will be a string of ones and zeros (any other
character will terminate the binary input). In this program, a “1” will cause the LED
to turn on and a “0” will cause the LED to turn off. Here’s an example of using the B1
query.
?B1 0011<CR>
The figure below shows an actual on-line session using the BASIC Stamp’s Debug
Terminal window.

Related parts for 27220