Download Print this page

Parallax 555-27401 Manual page 5

Qti sensor kickstart

Advertisement

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
long RCValue
PUB Go
debug.start(31, 30, 0, 115200)
RCValue := 0
repeat
rc.rctime(0, 1, @RCValue)
debug.dec(RCValue / 100)
debug.tx(13)
WaitCnt(ClkFreq / 4 + Cnt)
Note: This program uses the FullDuplexSerial object library, which is included with the
Propeller Tool software download. 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. Depending on
surface reflectivity, values will range from about 3 to 2000.
Arduino Uno
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(RCTime(2));
delay(250);
Copyright © Parallax Inc.
' Get RC value on 0
' Display results
' Delay 250ms, repeat
// Connect to pin 2, display results
// Wait 250 ms
Page 5 of 6

Advertisement

loading