Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/tutorial_samples/9_pulses.py
blob: 81eef2e02f8ca0dec0e320281c633dba6b160ce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)