Skip to content

Commit 6f4fa49

Browse files
committed
Uploading project
1 parent 66ac528 commit 6f4fa49

File tree

6 files changed

+76
-0
lines changed

6 files changed

+76
-0
lines changed

MacroKeyPad.pyw

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#! python3
2+
import pyautogui, sys, time, serial
3+
4+
port = 'COM6' #Windows COMX | Linux /dev/ttyUSBX or /dev/ttyACMX
5+
baud = 9600
6+
7+
NanoSerial = serial.Serial(port, baud)
8+
time.sleep(1)
9+
10+
print("MacroKeyPad:", port, baud)
11+
12+
while 1:
13+
data = str(NanoSerial.readline())[2]
14+
if data == '7':
15+
pyautogui.press('prevtrack') #Previous track
16+
elif data == '8':
17+
pyautogui.press('playpause') #Play/Pause
18+
elif data == '9':
19+
pyautogui.press('nexttrack') #Next track
20+
elif data == '4':
21+
pyautogui.press('volumedown') #Turn volume down
22+
elif data == '5':
23+
pyautogui.press('volumemute') #Turn volume on/off
24+
elif data == '6':
25+
pyautogui.press('volumeup') #Turn volume up
26+
elif data == '1':
27+
pyautogui.hotkey('ctrl', 'alt', 'c') #Chatting
28+
elif data == '2':
29+
pyautogui.hotkey('ctrl', 'alt', 'd') #Gaming
30+
elif data == '3':
31+
pyautogui.hotkey('ctrl', 'alt', 'f') #Waiting
32+
elif data == '*':
33+
pyautogui.hotkey('ctrl', 'alt','a') #Start/Stop streaming OBS
34+
elif data == '0':
35+
pyautogui.hotkey('ctrl', 'alt','b') #Start/Stop recording OBS
36+
elif data == '#':
37+
pyautogui.hotkey('ctrl', 'alt','e') #Transition OBS
38+
elif data == 'A':
39+
pyautogui.hotkey('ctrl', 'alt','g') #Mute/Unmute desktop
40+
elif data == 'B':
41+
pyautogui.hotkey('ctrl', 'alt', 'h') #Mute/Unmute headset
42+
elif data == 'C':
43+
pyautogui.hotkey('ctrl', 'alt','i') #Mute/Unmute mic
44+
elif data == 'D':
45+
pyautogui.hotkey('ctrl', 'alt','del')

MacroKeyPad/MacroKeyPad.ino

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include <Keypad.h>
2+
3+
const byte ROWS = 4;
4+
const byte COLS = 4;
5+
6+
//Your Keypad distribution
7+
const char hexaKeys[ROWS][COLS] = {
8+
{'D', '*', '0', '#'},
9+
{'C', '3', '2', '1'},
10+
{'B', '6', '5', '4'},
11+
{'A', '9', '8', '7'}
12+
};
13+
14+
//Digital pins for Rows and Cols
15+
byte rowPins[ROWS] = {9, 8, 7, 6};
16+
byte colPins[COLS] = {5, 4, 3, 2};
17+
18+
//Creates keypad object
19+
Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
20+
21+
void setup() {
22+
Serial.begin(9600);
23+
}
24+
25+
void loop() {
26+
char customKey = customKeypad.getKey();
27+
if (customKey) {
28+
//Print de key char from hexaKeys matrix
29+
Serial.println(customKey);
30+
}
31+
}

schematic/KEYPAD 4x4.fzpz

13.3 KB
Binary file not shown.

schematic/MacroKeyPad.fzz

15.9 KB
Binary file not shown.

schematic/MacroKeyPad.png

108 KB
Loading

schematic/Membrane Matrix Keypad.fzpz

8.33 KB
Binary file not shown.

0 commit comments

Comments
 (0)