-
Notifications
You must be signed in to change notification settings - Fork 1
/
SimpleWarp.py
42 lines (32 loc) · 854 Bytes
/
SimpleWarp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import Adafruit_BBIO.ADC as ADC
import mplayer as MP
from time import sleep
from random import randint
from math import floor
def checkKnob(potPin):
value = ADC.read(potPin)
return int(floor(5 * value))
def main():
ADC.setup()
potPin = 'P9_33'
running = True
# setup mplayer
video = MP.Player()
video.loadfile('/media/COS_66_F/simple.mov')
video.fullscreen = True
video.lopp = 100
timecode = 1
videoTimes = [ 254,
190,
90,
77,
1]
while running:
firstValue = checkKnob(potPin)
sleep(1)
secondValue = checkKnob(potPin)
if firstValue != secondValue:
timecode = videoTimes[checkKnob(potPin)]
video.time_pos = timecode
if __name__ == "__main__":
main()