Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/tutorial_samples/5_light.py
blob: 0f2cbee53969522da51d15ee583e960a7e15fabd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
DEFINE THRESHOLD=40

def main():
    DefineSensors(None,None,LIGHT,None)
    OnFwd(OUT_AC, 75)
    while True:
        if SensorVal(2) > THRESHOLD:
            OnRev(OUT_C, 75)
            Wait(100)
            
            while SensorVal(2) > THRESHOLD:
                pass
            
            OnFwd(OUT_AC, 75)