5: BASIC Stamp Command Reference – READ
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 263
location 255 holds the value 100, then your program can use locations 0–99
for data.
On other BASIC Stamps, you'll need to view the Memory Map of the
program before you download it, to determine the last EEPROM location
used. See the "Memory Map Function" section in Chapter 3.
On the BS2p, the READ and WRITE commands can affect locations in any
program slot as set by the STORE command. See the STORE command for
more information.
Demo Program (READ.bas)
' This program reads a string of data stored in EEPROM. The EEPROM data is downloaded
' to the BS1 at compile-time and remains there (even with the power off) until
' overwritten. Put ASCII characters into EEPROM, followed by 0, which will serve as the
' end-of-message marker.
'{$STAMP BS1} 'STAMP directive (specifies a BS1)
EEPROM ("BS1 EEPROM Storage!",0)
SYMBOL StrAddr = W0
SYMBOL Char = B2
StrAddr = 0 'Set address to start of Message.
StringOut:
READ StrAddr,Char 'Get a byte from EEPROM.
IF Char <> 0 THEN Cont 'Not end? Continue.
END 'Stop here when done.
Cont:
DEBUG @Char 'Show character on screen.
StrAddr = S 1 'Point to next character.
GOTO StringOut 'Get next character.
Demo Program (READ.bs2)
' This program reads a string of data stored in EEPROM. The EEPROM data is downloaded
' to the BS2 at compile-time and remains there (even with the power off) until
' overwritten. Put ASCII characters into EEPROM, followed by 0, which will serve as the
' end-of-message marker.
'{$STAMP BS2} 'STAMP directive (specifies a BS2)
Message DATA "BS2 EEPROM Storage!",0
StrAddr VAR WORD
Char VAR BYTE
1
2
e
2
sx
2
p
2
2
e
2
sx
2
p
2
NOTE: This is written for the BS2
but can be used for the BS2e,
BS2sx and BS2p also. Locate the
proper source code file or modify
the STAMP directive before
downloading to the BS2e, BS2sx or
BS2p.
p
2
Содержание BASIC Stamp 1
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...