-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (21 loc) · 1014 Bytes
/
main.py
File metadata and controls
29 lines (21 loc) · 1014 Bytes
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
import serial
import pyautogui
Arduino_Serial = serial.Serial('com12',9600)
while 1:
incoming_data = str (Arduino_Serial.readline())
print incoming_data
if 'next' in incoming_data:
pyautogui.hotkey('ctrl', 'pgdn')
if 'previous' in incoming_data:
pyautogui.hotkey('ctrl', 'pgup')
if 'down' in incoming_data:
#pyautogui.press('down')
pyautogui.scroll(-100)
if 'up' in incoming_data:
#pyautogui.press('up')
pyautogui.scroll(100)
if 'change' in incoming_data:
pyautogui.keyDown('alt')
pyautogui.press('tab')
pyautogui.keyUp('alt')
incoming_data = "";