mirror of
https://github.com/option8/RetroConnector.git
synced 2025-01-01 10:31:02 +00:00
initial push
added PCB files, arduino code for the IIe->USB adapter.
This commit is contained in:
commit
31c1c9c1df
BIN
IIe-USB/PCB/retro-connector-rev2-PCB.fzz
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB.fzz
Normal file
Binary file not shown.
26
IIe-USB/PCB/retro-connector-rev2-PCB_contour.gm1
Normal file
26
IIe-USB/PCB/retro-connector-rev2-PCB_contour.gm1
Normal file
@ -0,0 +1,26 @@
|
||||
G04 MADE WITH FRITZING*
|
||||
G04 WWW.FRITZING.ORG*
|
||||
G04 DOUBLE SIDED*
|
||||
G04 HOLES PLATED*
|
||||
G04 CONTOUR ON CENTER OF CONTOUR VECTOR*
|
||||
%ASAXBY*%
|
||||
%FSLAX23Y23*%
|
||||
%MOIN*%
|
||||
%OFA0B0*%
|
||||
%SFA1.0B1.0*%
|
||||
%ADD10R,3.149610X2.244090*%
|
||||
%ADD11C,0.008000*%
|
||||
%ADD10C,0.008*%
|
||||
%LNCONTOUR*%
|
||||
G90*
|
||||
G70*
|
||||
G54D10*
|
||||
G54D11*
|
||||
X8Y2236D02*
|
||||
X3150Y2236D01*
|
||||
X3150Y0D01*
|
||||
X8Y0D01*
|
||||
X8Y2236D01*
|
||||
D02*
|
||||
G04 End of contour*
|
||||
M02*
|
12518
IIe-USB/PCB/retro-connector-rev2-PCB_copperBottom.gbl
Normal file
12518
IIe-USB/PCB/retro-connector-rev2-PCB_copperBottom.gbl
Normal file
File diff suppressed because it is too large
Load Diff
15557
IIe-USB/PCB/retro-connector-rev2-PCB_copperTop.gtl
Normal file
15557
IIe-USB/PCB/retro-connector-rev2-PCB_copperTop.gtl
Normal file
File diff suppressed because it is too large
Load Diff
97
IIe-USB/PCB/retro-connector-rev2-PCB_drill.txt
Normal file
97
IIe-USB/PCB/retro-connector-rev2-PCB_drill.txt
Normal file
@ -0,0 +1,97 @@
|
||||
M48
|
||||
M72,TZ
|
||||
T10C0.038492
|
||||
T11C0.025000
|
||||
T12C0.040000
|
||||
T13C0.125984
|
||||
%
|
||||
T10
|
||||
X1.698140Y1.149650
|
||||
X1.998140Y1.349646
|
||||
X1.198140Y1.549646
|
||||
X1.098140Y1.549646
|
||||
X1.998140Y1.249646
|
||||
X0.098144Y0.949650
|
||||
X1.998140Y1.549646
|
||||
X1.898140Y1.549646
|
||||
X1.798140Y1.549646
|
||||
X1.698140Y1.549646
|
||||
X1.598140Y1.549646
|
||||
X1.498140Y1.549646
|
||||
X1.398140Y1.549646
|
||||
X1.298140Y1.549646
|
||||
X0.898144Y1.549646
|
||||
X0.998144Y1.549646
|
||||
X1.198140Y0.949650
|
||||
X1.098140Y0.949650
|
||||
X0.998144Y0.949650
|
||||
X0.898144Y0.949650
|
||||
X0.798144Y0.949650
|
||||
X0.698144Y0.949650
|
||||
X0.598144Y0.949650
|
||||
X0.498144Y0.949650
|
||||
X0.398144Y0.949650
|
||||
X0.298144Y0.949650
|
||||
X1.998140Y0.949650
|
||||
X1.898140Y0.949650
|
||||
X1.798140Y0.949650
|
||||
X1.698140Y0.949650
|
||||
X1.598140Y0.949650
|
||||
X1.498140Y0.949650
|
||||
X1.398140Y0.949650
|
||||
X1.298140Y0.949650
|
||||
X0.198144Y0.949650
|
||||
X0.198144Y1.549646
|
||||
X0.298144Y1.549646
|
||||
X0.398144Y1.549646
|
||||
X0.498144Y1.549646
|
||||
X0.598144Y1.549646
|
||||
X0.698144Y1.549646
|
||||
X0.798144Y1.549646
|
||||
X1.698140Y1.349646
|
||||
X1.598140Y1.349646
|
||||
X1.498140Y1.349646
|
||||
X1.398140Y1.349646
|
||||
X1.698140Y1.249646
|
||||
X1.598140Y1.249646
|
||||
X1.498140Y1.249646
|
||||
X1.398140Y1.249646
|
||||
X1.998140Y1.149650
|
||||
X0.098144Y1.549646
|
||||
T11
|
||||
X0.688144Y1.233650
|
||||
X0.688144Y1.285646
|
||||
T12
|
||||
X2.398140Y0.249650
|
||||
X2.398140Y0.349650
|
||||
X2.398140Y0.449650
|
||||
X2.398140Y0.549650
|
||||
X2.398140Y0.649650
|
||||
X2.398140Y0.749650
|
||||
X2.398140Y0.849650
|
||||
X2.398140Y0.949650
|
||||
X2.398140Y1.049650
|
||||
X2.398140Y1.149650
|
||||
X2.398140Y1.249646
|
||||
X2.398140Y1.349646
|
||||
X2.398140Y1.449646
|
||||
X2.498140Y0.249650
|
||||
X2.498140Y0.349650
|
||||
X2.498140Y0.449650
|
||||
X2.498140Y0.549650
|
||||
X2.498140Y0.649650
|
||||
X2.498140Y0.749650
|
||||
X2.498140Y0.849650
|
||||
X2.498140Y0.949650
|
||||
X2.498140Y1.049650
|
||||
X2.498140Y1.149650
|
||||
X2.498140Y1.249646
|
||||
X2.498140Y1.349646
|
||||
X2.498140Y1.449646
|
||||
T13
|
||||
X0.198147Y0.249650
|
||||
X0.198147Y2.049643
|
||||
X2.998140Y0.249650
|
||||
X2.998140Y2.049643
|
||||
T00
|
||||
M30
|
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_copper_bottom.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_copper_bottom.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_copper_top.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_copper_top.pdf
Normal file
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_copper_top_mirror.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_copper_top_mirror.pdf
Normal file
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_bottom.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_bottom.pdf
Normal file
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_bottom_mirror.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_bottom_mirror.pdf
Normal file
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_top.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_top.pdf
Normal file
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_top_mirror.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_mask_top_mirror.pdf
Normal file
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_paste_mask_bottom.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_paste_mask_bottom.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_paste_mask_top.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_paste_mask_top.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_silk_top.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_silk_top.pdf
Normal file
Binary file not shown.
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_silk_top_mirror.pdf
Normal file
BIN
IIe-USB/PCB/retro-connector-rev2-PCB_etch_silk_top_mirror.pdf
Normal file
Binary file not shown.
111
IIe-USB/PCB/retro-connector-rev2-PCB_maskBottom.gbs
Normal file
111
IIe-USB/PCB/retro-connector-rev2-PCB_maskBottom.gbs
Normal file
@ -0,0 +1,111 @@
|
||||
G04 MADE WITH FRITZING*
|
||||
G04 WWW.FRITZING.ORG*
|
||||
G04 DOUBLE SIDED*
|
||||
G04 HOLES PLATED*
|
||||
G04 CONTOUR ON CENTER OF CONTOUR VECTOR*
|
||||
%ASAXBY*%
|
||||
%FSLAX23Y23*%
|
||||
%MOIN*%
|
||||
%OFA0B0*%
|
||||
%SFA1.0B1.0*%
|
||||
%ADD10C,0.078892*%
|
||||
%ADD11C,0.048000*%
|
||||
%ADD12C,0.080000*%
|
||||
%ADD13C,0.131984*%
|
||||
%ADD14R,0.080000X0.080000*%
|
||||
%LNMASK0*%
|
||||
G90*
|
||||
G70*
|
||||
G54D10*
|
||||
X98Y1550D03*
|
||||
X1998Y1150D03*
|
||||
X1398Y1250D03*
|
||||
X1498Y1250D03*
|
||||
X1598Y1250D03*
|
||||
X1698Y1250D03*
|
||||
X1398Y1350D03*
|
||||
X1498Y1350D03*
|
||||
X1598Y1350D03*
|
||||
X1698Y1350D03*
|
||||
X798Y1550D03*
|
||||
X698Y1550D03*
|
||||
X598Y1550D03*
|
||||
X498Y1550D03*
|
||||
X398Y1550D03*
|
||||
X298Y1550D03*
|
||||
X198Y1550D03*
|
||||
X198Y950D03*
|
||||
X1298Y950D03*
|
||||
X1398Y950D03*
|
||||
X1498Y950D03*
|
||||
X1598Y950D03*
|
||||
X1698Y950D03*
|
||||
X1798Y950D03*
|
||||
X1898Y950D03*
|
||||
X1998Y950D03*
|
||||
X298Y950D03*
|
||||
X398Y950D03*
|
||||
X498Y950D03*
|
||||
X598Y950D03*
|
||||
X698Y950D03*
|
||||
X798Y950D03*
|
||||
X898Y950D03*
|
||||
X998Y950D03*
|
||||
X1098Y950D03*
|
||||
X1198Y950D03*
|
||||
G54D11*
|
||||
X688Y1286D03*
|
||||
X688Y1234D03*
|
||||
G54D10*
|
||||
X998Y1550D03*
|
||||
X898Y1550D03*
|
||||
X1298Y1550D03*
|
||||
X1398Y1550D03*
|
||||
X1498Y1550D03*
|
||||
X1598Y1550D03*
|
||||
X1698Y1550D03*
|
||||
X1798Y1550D03*
|
||||
X1898Y1550D03*
|
||||
X1998Y1550D03*
|
||||
X98Y950D03*
|
||||
X1998Y1250D03*
|
||||
X1098Y1550D03*
|
||||
X1198Y1550D03*
|
||||
X1998Y1350D03*
|
||||
X1698Y1150D03*
|
||||
G54D12*
|
||||
X2498Y1450D03*
|
||||
X2498Y1350D03*
|
||||
X2498Y1250D03*
|
||||
X2498Y1150D03*
|
||||
X2498Y1050D03*
|
||||
X2498Y950D03*
|
||||
X2498Y850D03*
|
||||
X2498Y750D03*
|
||||
X2498Y650D03*
|
||||
X2498Y550D03*
|
||||
X2498Y450D03*
|
||||
X2498Y350D03*
|
||||
X2498Y250D03*
|
||||
X2398Y1450D03*
|
||||
X2398Y1350D03*
|
||||
X2398Y1250D03*
|
||||
X2398Y1150D03*
|
||||
X2398Y1050D03*
|
||||
X2398Y950D03*
|
||||
X2398Y850D03*
|
||||
X2398Y750D03*
|
||||
X2398Y650D03*
|
||||
X2398Y550D03*
|
||||
X2398Y450D03*
|
||||
X2398Y350D03*
|
||||
X2398Y250D03*
|
||||
G54D13*
|
||||
X2998Y2050D03*
|
||||
X2998Y250D03*
|
||||
X198Y2050D03*
|
||||
X198Y250D03*
|
||||
G54D14*
|
||||
X2398Y1450D03*
|
||||
G04 End of Mask0*
|
||||
M02*
|
111
IIe-USB/PCB/retro-connector-rev2-PCB_maskTop.gts
Normal file
111
IIe-USB/PCB/retro-connector-rev2-PCB_maskTop.gts
Normal file
@ -0,0 +1,111 @@
|
||||
G04 MADE WITH FRITZING*
|
||||
G04 WWW.FRITZING.ORG*
|
||||
G04 DOUBLE SIDED*
|
||||
G04 HOLES PLATED*
|
||||
G04 CONTOUR ON CENTER OF CONTOUR VECTOR*
|
||||
%ASAXBY*%
|
||||
%FSLAX23Y23*%
|
||||
%MOIN*%
|
||||
%OFA0B0*%
|
||||
%SFA1.0B1.0*%
|
||||
%ADD10C,0.078892*%
|
||||
%ADD11C,0.048000*%
|
||||
%ADD12C,0.080000*%
|
||||
%ADD13C,0.131984*%
|
||||
%ADD14R,0.080000X0.080000*%
|
||||
%LNMASK1*%
|
||||
G90*
|
||||
G70*
|
||||
G54D10*
|
||||
X98Y1550D03*
|
||||
X1998Y1150D03*
|
||||
X1398Y1250D03*
|
||||
X1498Y1250D03*
|
||||
X1598Y1250D03*
|
||||
X1698Y1250D03*
|
||||
X1398Y1350D03*
|
||||
X1498Y1350D03*
|
||||
X1598Y1350D03*
|
||||
X1698Y1350D03*
|
||||
X798Y1550D03*
|
||||
X698Y1550D03*
|
||||
X598Y1550D03*
|
||||
X498Y1550D03*
|
||||
X398Y1550D03*
|
||||
X298Y1550D03*
|
||||
X198Y1550D03*
|
||||
X198Y950D03*
|
||||
X1298Y950D03*
|
||||
X1398Y950D03*
|
||||
X1498Y950D03*
|
||||
X1598Y950D03*
|
||||
X1698Y950D03*
|
||||
X1798Y950D03*
|
||||
X1898Y950D03*
|
||||
X1998Y950D03*
|
||||
X298Y950D03*
|
||||
X398Y950D03*
|
||||
X498Y950D03*
|
||||
X598Y950D03*
|
||||
X698Y950D03*
|
||||
X798Y950D03*
|
||||
X898Y950D03*
|
||||
X998Y950D03*
|
||||
X1098Y950D03*
|
||||
X1198Y950D03*
|
||||
G54D11*
|
||||
X688Y1286D03*
|
||||
X688Y1234D03*
|
||||
G54D10*
|
||||
X998Y1550D03*
|
||||
X898Y1550D03*
|
||||
X1298Y1550D03*
|
||||
X1398Y1550D03*
|
||||
X1498Y1550D03*
|
||||
X1598Y1550D03*
|
||||
X1698Y1550D03*
|
||||
X1798Y1550D03*
|
||||
X1898Y1550D03*
|
||||
X1998Y1550D03*
|
||||
X98Y950D03*
|
||||
X1998Y1250D03*
|
||||
X1098Y1550D03*
|
||||
X1198Y1550D03*
|
||||
X1998Y1350D03*
|
||||
X1698Y1150D03*
|
||||
G54D12*
|
||||
X2498Y1450D03*
|
||||
X2498Y1350D03*
|
||||
X2498Y1250D03*
|
||||
X2498Y1150D03*
|
||||
X2498Y1050D03*
|
||||
X2498Y950D03*
|
||||
X2498Y850D03*
|
||||
X2498Y750D03*
|
||||
X2498Y650D03*
|
||||
X2498Y550D03*
|
||||
X2498Y450D03*
|
||||
X2498Y350D03*
|
||||
X2498Y250D03*
|
||||
X2398Y1450D03*
|
||||
X2398Y1350D03*
|
||||
X2398Y1250D03*
|
||||
X2398Y1150D03*
|
||||
X2398Y1050D03*
|
||||
X2398Y950D03*
|
||||
X2398Y850D03*
|
||||
X2398Y750D03*
|
||||
X2398Y650D03*
|
||||
X2398Y550D03*
|
||||
X2398Y450D03*
|
||||
X2398Y350D03*
|
||||
X2398Y250D03*
|
||||
G54D13*
|
||||
X2998Y2050D03*
|
||||
X2998Y250D03*
|
||||
X198Y2050D03*
|
||||
X198Y250D03*
|
||||
G54D14*
|
||||
X2398Y1450D03*
|
||||
G04 End of Mask1*
|
||||
M02*
|
7013
IIe-USB/PCB/retro-connector-rev2-PCB_silkTop.gto
Normal file
7013
IIe-USB/PCB/retro-connector-rev2-PCB_silkTop.gto
Normal file
File diff suppressed because it is too large
Load Diff
BIN
IIe-USB/arduino/.DS_Store
vendored
Normal file
BIN
IIe-USB/arduino/.DS_Store
vendored
Normal file
Binary file not shown.
248
IIe-USB/arduino/IIe_keyboard/IIe_keyboard.ino
Normal file
248
IIe-USB/arduino/IIe_keyboard/IIe_keyboard.ino
Normal file
@ -0,0 +1,248 @@
|
||||
/* requires keypad library by Mark Stanley, Alexander Brevig from:
|
||||
http://www.arduino.cc/playground/Code/Keypad
|
||||
|
||||
Uses the PJRC Teensy++ 2.0 and Teensyduino libraries, specifically USB HID and Keyboard():
|
||||
http://www.pjrc.com/teensy/teensyduino.html
|
||||
*/
|
||||
|
||||
#include <Keypad.h>
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Declares the matrix rows/cols of the Apple IIe keyboard.
|
||||
|
||||
More information here:
|
||||
http://apple2.info/wiki/index.php?title=Pinouts#Apple_.2F.2Fe_Motherboard_keyboard_connector
|
||||
*/
|
||||
|
||||
const byte ROWS = 10; // rows
|
||||
const byte COLS = 8; // columns
|
||||
char keys[ROWS][COLS] = {
|
||||
|
||||
|
||||
{ KEY_ESC, KEY_TAB, KEY_A, KEY_Z, 0,0,0,0},
|
||||
|
||||
{ KEY_1, KEY_Q, KEY_D, KEY_X, 0,0,0,0},
|
||||
|
||||
{ KEY_2, KEY_W, KEY_S, KEY_C, 0,0,0,0},
|
||||
|
||||
{ KEY_3, KEY_E, KEY_H, KEY_V, 0,0,0,0},
|
||||
|
||||
{ KEY_4, KEY_R, KEY_F, KEY_B, 0,0,0,0},
|
||||
|
||||
{ KEY_6, KEY_Y, KEY_G, KEY_N, 0,0,0,0},
|
||||
|
||||
{ KEY_5, KEY_T, KEY_J, KEY_M, KEY_BACKSLASH, KEY_TILDE, KEY_ENTER, KEY_BACKSPACE},
|
||||
|
||||
{ KEY_7, KEY_U, KEY_K, KEY_COMMA, KEY_EQUAL, KEY_P, KEY_UP, KEY_DOWN },
|
||||
|
||||
{ KEY_8, KEY_I, KEY_SEMICOLON, KEY_PERIOD, KEY_0, KEY_LEFT_BRACE, KEY_SPACE, KEY_LEFT },
|
||||
|
||||
{ KEY_9, KEY_O, KEY_L, KEY_SLASH, KEY_MINUS, KEY_RIGHT_BRACE, KEY_QUOTE, KEY_RIGHT },
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
XO X1 X2 X3 | X4 X5 X6 X7
|
||||
------------------------------------+--------------------------------
|
||||
YO ESC TAB A Z | / ) * ESC
|
||||
|
|
||||
Y1 1! Q D X | DOWN UP LEFT RIGHT
|
||||
|
|
||||
Y2 20 W S C | 0 4 8 (
|
||||
|
|
||||
Y3 34 E H V | 1 5 9 -
|
||||
|
|
||||
Y4 4$ R F S | 2 6 . RETURN
|
||||
|
|
||||
Y5 6" Y G N | 3 7 + ,
|
||||
+----------------------------------
|
||||
Y6 5% T J M \| `~ RETURN DELETE
|
||||
|
||||
Y7 7& U K ,< += P UP DOWN
|
||||
|
||||
Y8 8* I ;: .> 0) [{ SPACE LEFT
|
||||
|
||||
Y9 9( O L /? -_ ]} '" RIGHT
|
||||
|
||||
|
||||
The RetroConnector IIe maps the 26 Apple IIe pins to Teensy++ pins
|
||||
|
||||
IIe Col/Row Teensy
|
||||
1 Y0 10
|
||||
2 Y1 45
|
||||
3 +5V +5v
|
||||
4 Y2 44
|
||||
5 SW1/CAPL 9
|
||||
6 Y3 43
|
||||
7 SW0/OAPL 8
|
||||
8 Y4 42
|
||||
9 CAPLOCK* 7
|
||||
10 Y5 41
|
||||
11 CNTL* 5
|
||||
12 Y8 40
|
||||
13 GND GND
|
||||
14 X0 39
|
||||
15 RESET* 4
|
||||
16 X2 38
|
||||
17 X7 3
|
||||
18 X1 18
|
||||
19 X5 2
|
||||
20 X3 19
|
||||
21 X4 1
|
||||
22 Y9 20
|
||||
23 Y6 0
|
||||
24 SHFT* 21
|
||||
25 Y7 27
|
||||
26 X6 22
|
||||
|
||||
*/
|
||||
|
||||
byte rowPins[ROWS] = { // Y0 - Y9
|
||||
10, 45, 44, 43, 42, 41, 0, 27, 40, 20}; //connect to the row pinouts of the keypad
|
||||
|
||||
byte colPins[COLS] = { // X0 - X7
|
||||
39, 18, 38, 19, 1, 2, 22, 3}; //connect to the column pinouts of the keypad
|
||||
|
||||
Keypad KPD = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
|
||||
|
||||
|
||||
const int SHIFTPin = 21; // the pin that the shift key is attached to
|
||||
const int CTRLPin = 5; // the pin that the control key is attached to
|
||||
const int APPLEPin1 = 8; // the pin that the open-apple key is attached to
|
||||
const int APPLEPin2 = 9; // the pin that the closed-apple key is attached to
|
||||
// these pins are special in that they are dis/connected to ground, instead of to a row/col
|
||||
|
||||
|
||||
|
||||
char modifierKeys[4];
|
||||
|
||||
|
||||
void setup(){
|
||||
|
||||
pinMode(SHIFTPin, INPUT);
|
||||
pinMode(CTRLPin, INPUT);
|
||||
pinMode(APPLEPin1, INPUT);
|
||||
pinMode(APPLEPin2, INPUT);
|
||||
|
||||
digitalWrite(APPLEPin1, LOW);
|
||||
digitalWrite(APPLEPin2, LOW);
|
||||
|
||||
digitalWrite(SHIFTPin, HIGH);
|
||||
digitalWrite(CTRLPin, HIGH);
|
||||
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
|
||||
char SHIFTState = digitalRead(SHIFTPin);
|
||||
|
||||
if (SHIFTState == LOW) {
|
||||
modifierKeys[0] = MODIFIERKEY_SHIFT;
|
||||
digitalWrite(SHIFTPin, HIGH);
|
||||
} else {
|
||||
digitalWrite(SHIFTPin, HIGH);
|
||||
modifierKeys[0] = 0;
|
||||
}
|
||||
|
||||
char CTRLState = digitalRead(CTRLPin);
|
||||
|
||||
if (CTRLState == LOW) {
|
||||
modifierKeys[1] = MODIFIERKEY_CTRL;
|
||||
digitalWrite(CTRLPin, HIGH);
|
||||
} else {
|
||||
modifierKeys[1] = 0;
|
||||
digitalWrite(CTRLPin, HIGH);
|
||||
}
|
||||
|
||||
char OAPPLEState = digitalRead(APPLEPin1);
|
||||
char CAPPLEState = digitalRead(APPLEPin2);
|
||||
|
||||
/* if (OAPPLEState == HIGH) {
|
||||
modifierKeys[2] = MODIFIERKEY_GUI;
|
||||
} else if (CAPPLEState == HIGH) {
|
||||
modifierKeys[2] = MODIFIERKEY_GUI;
|
||||
} else {
|
||||
modifierKeys[2] = 0;
|
||||
}
|
||||
digitalWrite(APPLEPin1, LOW);
|
||||
digitalWrite(APPLEPin2, LOW);
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// *** NOW USING CLOSED APPLE AS ALT/OPTION
|
||||
if (OAPPLEState == HIGH) {
|
||||
modifierKeys[2] = MODIFIERKEY_GUI;
|
||||
digitalWrite(APPLEPin1, LOW);
|
||||
} else {
|
||||
modifierKeys[2] = 0;
|
||||
digitalWrite(APPLEPin1, LOW);
|
||||
}
|
||||
|
||||
if (CAPPLEState == HIGH) {
|
||||
modifierKeys[3] = MODIFIERKEY_ALT;
|
||||
digitalWrite(APPLEPin2, LOW);
|
||||
} else {
|
||||
modifierKeys[3] = 0;
|
||||
digitalWrite(APPLEPin2, LOW);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// to use the TILDE key as ALT/OPTION
|
||||
/* modifierKeys[3] = 0;
|
||||
if( KPD.isPressed(KEY_TILDE) ) {
|
||||
modifierKeys[3] = MODIFIERKEY_ALT;
|
||||
}
|
||||
*/
|
||||
|
||||
// *** NOW USING CLOSED APPLE AS ALT/OPTION
|
||||
|
||||
Keyboard.set_modifier( modifierKeys[0] | modifierKeys[1] | modifierKeys[2] | modifierKeys[3] );
|
||||
|
||||
KPD.getKeys(); // Scan for all pressed keys. 6 Max, + 4 modifiers. Should be plenty, but can be extended to 10+
|
||||
|
||||
// Set keyboard keys to default values.
|
||||
Keyboard.set_key1(0);
|
||||
Keyboard.set_key2(0);
|
||||
Keyboard.set_key3(0);
|
||||
Keyboard.set_key4(0);
|
||||
Keyboard.set_key5(0);
|
||||
Keyboard.set_key6(0);
|
||||
|
||||
// Update keyboard keys to active values.
|
||||
if( KPD.key[0].kchar && ( KPD.key[0].kstate==PRESSED || KPD.key[0].kstate==HOLD ))
|
||||
Keyboard.set_key1( KPD.key[0].kchar );
|
||||
|
||||
if( KPD.key[1].kchar && ( KPD.key[1].kstate==PRESSED || KPD.key[1].kstate==HOLD ))
|
||||
Keyboard.set_key2( KPD.key[1].kchar );
|
||||
|
||||
if( KPD.key[2].kchar && ( KPD.key[2].kstate==PRESSED || KPD.key[2].kstate==HOLD ))
|
||||
Keyboard.set_key3( KPD.key[2].kchar );
|
||||
|
||||
if( KPD.key[3].kchar && ( KPD.key[3].kstate==PRESSED || KPD.key[3].kstate==HOLD ))
|
||||
Keyboard.set_key4( KPD.key[3].kchar );
|
||||
|
||||
if( KPD.key[4].kchar && ( KPD.key[4].kstate==PRESSED || KPD.key[4].kstate==HOLD ))
|
||||
Keyboard.set_key5( KPD.key[4].kchar );
|
||||
|
||||
if( KPD.key[5].kchar && ( KPD.key[5].kstate==PRESSED || KPD.key[5].kstate==HOLD ))
|
||||
Keyboard.set_key6( KPD.key[5].kchar );
|
||||
|
||||
Keyboard.send_now();
|
||||
Keyboard.set_modifier(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user