diff --git a/.DS_Store b/.DS_Store index 4122f8a..193e50a 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/IIc-USB/Arduino/IIc_keyboard/IIc_keyboard.ino b/IIc-USB/Arduino/IIc_keyboard/IIc_keyboard.ino index 16d3374..92f0140 100644 --- a/IIc-USB/Arduino/IIc_keyboard/IIc_keyboard.ino +++ b/IIc-USB/Arduino/IIc_keyboard/IIc_keyboard.ino @@ -10,11 +10,7 @@ http://www.pjrc.com/teensy/teensyduino.html /* -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 - +Declares the matrix rows/cols of the Apple IIc keyboard. */ diff --git a/IIc-USB/IIc keyboard pinouts.txt b/IIc-USB/IIc keyboard pinouts.txt index 61b45b7..4509fff 100644 --- a/IIc-USB/IIc keyboard pinouts.txt +++ b/IIc-USB/IIc keyboard pinouts.txt @@ -80,7 +80,7 @@ J9 pinout 20 Y3 21 GROUND ??? 22 X2 -23 GROUND ??? +23 5V ??? 24 X1 25 POWER LED (5v) 26 OPEN APPLE diff --git a/IIe-USB/arduino/.DS_Store b/IIe-USB/arduino/.DS_Store index ad6c4a3..9a6520c 100644 Binary files a/IIe-USB/arduino/.DS_Store and b/IIe-USB/arduino/.DS_Store differ diff --git a/USB_IIe_Kbd/Arduino/USB_IIe_Kbd/USB_IIe_Kbd.ino b/USB_IIe_Kbd/Arduino/USB_IIe_Kbd/USB_IIe_Kbd.ino index 710229d..8d02a32 100644 --- a/USB_IIe_Kbd/Arduino/USB_IIe_Kbd/USB_IIe_Kbd.ino +++ b/USB_IIe_Kbd/Arduino/USB_IIe_Kbd/USB_IIe_Kbd.ino @@ -521,7 +521,7 @@ class KbdRptParser : public KeyboardReportParser { void PrintKey(uint8_t mod, uint8_t key); - void PrintLine(); + void PrintLine(int macro); protected: virtual void OnKeyDown (uint8_t mod, uint8_t key); @@ -529,13 +529,25 @@ protected: virtual void OnKeyPressed(uint8_t key); }; -void KbdRptParser::PrintLine() + +char* macrostrings[4]= { + "CALL -151\n", + "8:20 35 FD 20 ED FD 4C 8 0 8G WeaknessPoint Minus by Martin Haye\n", + "5 rem Joystick Calibration \n10 print pdl(0) \" \" pdl(1) \" \" peek(-16287) \" \" peek(-16286) : goto 10\n run\n", + "2000:20 35 FD C9 95 D0 2 B1\n :28 C9 94 D0 9 98 69 3\n :29 FC 85 24 D0 EA C9 8E\n :D0 8 A5 32 49 C0 85 32\n :D0 DE 20 ED FD 18 90 D8 \n" +}; + + +void KbdRptParser::PrintLine(int macro) { - int CharDelay = 50; - String TestWord = "10 print pdl(0) \" \" pdl(1) \" \" peek(-16287) \" \" peek(-16286)"; //{97,98,67,68}; //abCD - char SHIFTDOWN = 0; + int CharDelay = 60; + //10 print pdl(0) " " pdl(1) " " peek(-16287) " " peek(-16286) : goto 10 + + String TestWord = macrostrings[macro]; + char SHIFTDOWN = 0; + // break up word into array of characters // for each character in array @@ -545,10 +557,10 @@ void KbdRptParser::PrintLine() // send keydown, wait X miliseconds, send keyup for(int letters=0; letters < TestWord.length(); letters++ ) { - Serial.print(KEYMAP[TestWord[letters]][0]); // look up the USB byte from the KEYMAP array. +// Serial.print(KEYMAP[TestWord[letters]][0]); // look up the USB byte from the KEYMAP array. if(KEYMAP[TestWord[letters]][1] == 1) { - Serial.print("!"); // hold shift +// Serial.print("!"); // hold shift SHIFTDOWN = 2; } else { SHIFTDOWN = 0; @@ -710,9 +722,20 @@ Serial.print( "SEARCH_ROW = " ); // trying a sample macro: - if(key == 68) { // 0x44 == 68 == key_F11 - - PrintLine(); + if(key == 58) { // 0x3A == 58 == key_F1 + PrintLine(0); + } + + if(key == 59) { // == key_F2 + PrintLine(1); + } + + if(key == 60) { // == key_F3 + PrintLine(2); + } + + if(key == 61) { // == key_F4 + PrintLine(3); } diff --git a/USB_IIe_Kbd/README.md b/USB_IIe_Kbd/README.md index 6ca1ea6..51bf9cc 100644 --- a/USB_IIe_Kbd/README.md +++ b/USB_IIe_Kbd/README.md @@ -9,9 +9,33 @@ Function Keys The F12 key sends CTRL+Reset. -F11 is a demo of macros, which are experimental at this point. It sends a short BASIC program useful for testing and calibrating joysticks. - 10 print pdl(0) " " pdl(1) " " peek(-16287) " " peek(-16286) +Macros +====== + +There are currently three handy macros included in the Keyboard Interface firmware. The are triggered by the F-keys F1 through F3. + + +_F1: enter the Monitor_ + CALL -151 + +_F2: WeaknessPoint Minus by Martin Haye_ + 8:20 35 FD 20 ED FD 4C 8 0 8G + +This is Martin's minimal presentation interface (i.e. "Not PowerPoint") + +To clear the screen and begin typing, hit ESC, then @. + +To navigate the screen, hit ESC, then I,J,K, or M. Then ESC again to edit. + + +_F3: Calibrate joysticks_ + 10 print pdl(0) " " pdl(1) " " peek(-16287) " " peek(-16286) : goto 10 + +Center on your joystick should read (approximately) 127 127. + +The third and fourth numbers in the display are the joystick buttons. Pressed, they should read higher than 128, and lower than 128 when not pressed. + Hardware Buttons