Copyright © Parallax Inc. Page 5 of 6
pst.start(115200) ' Start Terminal at 115200 baud
pst.str (string("Warming up..."))
waitcnt(clkfreq * 20 + cnt) ' PIR "warm-up" time
pst.clear ' Clear the screen
repeat
state := ina[0] ' Save state of PIR Sensor
pst.home ' Move cursor to upper left
pst.str(string("IN0 = "))
pst.bin(state, 1) ' Display results
waitcnt(clkfreq/200 + cnt) ' Small delay
Note: This program uses the Parallax Serial Terminal object library, which is included with the
Propeller Tool software download.
Note: To view the results of the demonstration, after uploading is complete run the Parallax
Serial Terminal from the Run menu, or press F12. Momentarily depress the Reset button on the
Propeller QuickStart board to restart the program.
Arduino Uno
void setup() {
Serial.begin(9600);
Serial.println("Warming up...");
delay(20000);
}
void loop() {
Serial.print("IN2 = ");
Serial.println(digitalRead(2), DEC);
delay(200);
}
Note: To view the results of the demonstration, after uploading is complete click the Serial
Monitor icon in the Arduino IDE. This displays the Serial Monitor window. Momentarily
depress the Reset button on the Arduino board to restart the sketch.