SEROUT - BASIC Stamp Command Reference
Page 306
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
2. Pay attention to timing.
a. Be very careful to calculate and overestimate the amount of
time operations should take within the BASIC Stamp.
Misunderstanding the timing constraints is the source of most
problems with code that communicate serially.
b. If the serial communication in your project is bi-directional,
the above statement is even more critical.
3. Pay attention to wiring.
a. Take extra time to study and verify serial communication
wiring diagrams. A mistake in wiring can cause strange
problems in communication, or no communication at all.
Make sure to connect the ground pins (Vss) between the
devices that are communicating serially.
4. Verify port setting on the PC and in the SERIN/SEROUT
commands.
a. Unmatched settings on the sender and receiver side will cause
garbled data transfers or no data transfers. If the data you
receive is unreadable, it is most likely a baud rate setting
error.
5. If data transmitted to the Stamp Editor's Debug Terminal is
garbled, verify the output format.
a. A common mistake is to send data with SEROUT in ASCII
format. For example, SEROUT 16, 84, [ 0 ] instead of
SEROUT 16, 84, [ DEC 0 ]. The first example will send a byte
equal to 0 to the PC, resulting in the Debug Terminal clearing
the screen (since 0 is the control character for a clear-screen
action).
Demo Program (SEROUT.bas)
' This program transmits the characters "A", "B", "C" and "D" (Inverted 2400 baud, N81) on
' I/O pin 0, followed by a number and a carriage return.
'{$STAMP BS1} 'STAMP directive (specifies a BS1)
SYMBOL Result = W0
Result = 1500
Loop:
SERIN 0, N2400, ("ABCD"), #Result
PAUSE 1000
GOTO Loop
1
Содержание BASIC Stamp 2e
Страница 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...