PULSOUT - BASIC Stamp Command Reference
Page 244
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
10k resistor sets the state on the pin. When PULSOUT executes, it turns on
the output driver, allowing OUT7 (PIN7 on the BS1) to control the pin.
Since OUT7 (PIN7 on the BS1) is low, the pin goes low. After a few
microseconds of preparation, PULSOUT inverts the state of the pin; from
low to high. It leaves the pin in that state for the specified time (10µs if
using a BS2) and then inverts it again, leaving the pin in its original state.
Demo Program (PULSOUT.bas)
' This program blinks an LED on for 10ms at 1-second intervals. Connect the LED to I/O
' pin 0 as shown in the figure within the NAP command description of the manual.
'{$STAMP BS1} 'STAMP directive (specifies a BS1)
HIGH 0 ' Set the pin high (LED off).
Again:
PULSOUT 0, 1000 ' Flash the LED for 10 ms.
PAUSE 1000 ' Wait one second.
GOTO Again ' Repeat endlessly.
Demo Program (PULSOUT.bs2)
' This program blinks an LED on for 10ms at 1-second intervals. Connect the LED to I/O
' pin 0 as shown in the figure within the NAP command description of the manual.
'{$STAMP BS2} 'STAMP directive (specifies a BS2)
HIGH 0 ' Set the pin high (LED off).
Again:
PULSOUT 0, 5000 ' Flash the LED for 10 ms.
PAUSE 1000 ' Wait one second.
GOTO Again ' Repeat endlessly.
2
e
2
sx
2
p
2
1
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. Keep in mind that the unit of
time may be different than what
appears in the comments here.
a
b
Vdd
10 k
Ω
P7
(instruction
executes)
PULSOUT 7,5
positive pulse
O-scope
pin 7 can be connected to an
oscilloscope as shown to
view the results shown on
the right
pin 7 in input mode
(DIR7 = 0,
OUT7 = 0)
but held high by
resistor to Vdd
pin changes to
output
pin left as
output - low
(DIR7 = 1,
OUT7 = 0)
Figure 5.26: Example Pulse
Diagram.
Содержание 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...