Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pynxc/tutorial_samples/5_sound.py
blob: ee8c146e1ff66c112a08583b4c3779fd19b2e455 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
DEFINE THRESHOLD=40
DEFINE MIC=SensorVal(2)

def main():
    DefineSensors(None,SOUND,None,None)
    while True: 
        while (MIC <= THRESHOLD):
            pass
        
        OnFwd(OUT_AC, 75)
        Wait(300)
         
         
        while (MIC <= THRESHOLD):
           pass

        Off(OUT_AC)
        Wait(300)