diff options
Diffstat (limited to 'pynxc/tutorial_samples/9_pulses.py')
-rw-r--r-- | pynxc/tutorial_samples/9_pulses.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pynxc/tutorial_samples/9_pulses.py b/pynxc/tutorial_samples/9_pulses.py new file mode 100644 index 0000000..81eef2e --- /dev/null +++ b/pynxc/tutorial_samples/9_pulses.py @@ -0,0 +1,14 @@ +def main(): + SetSensorType(IN_1, SENSOR_TYPE_TOUCH) + SetSensorMode(IN_1, SENSOR_MODE_PULSE) + while True: + + ClearSensor(IN_1) + while SENSOR_1<=0: + pass + + Wait(500) + if SENSOR_1 == 1: + Off(OUT_AC) + if SENSOR_1 == 2: + OnFwd(OUT_AC, 75) |