pin 23 errata. caps lock fix rolled back.

This commit is contained in:
Charles Mangin 2013-07-28 13:48:06 -04:00
parent b77765a6c3
commit eac1b7e6af
7 changed files with 16 additions and 18 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -127,7 +127,7 @@ J9 pinout
20 Y3 20 Y3
21 GROUND ??? 21 GROUND ???
22 X2 22 X2
23 5V 23 GROUND ???
24 X1 24 X1
25 POWER LED (5v) 25 POWER LED (5v)
26 OPEN APPLE 26 OPEN APPLE
@ -210,17 +210,7 @@ void loop()
//probably should be on an interrupt, to catch high->low transition //probably should be on an interrupt, to catch high->low transition
CAPSState = digitalRead(CAPSPin); // Only do something if the pin is different from previous state.
if ((int(keyboard_leds) & 2) == CAPSState) {
if (CAPSState == HIGH) {
Keyboard.set_key6(KEY_CAPS_UNLOCK);
}
else {
Keyboard.set_key6(KEY_CAPS_LOCK);
}
}
/* // Only do something if the pin is different from previous state.
if ( (CAPSState!=digitalRead(CAPSPin)) && !resetCapsLock) { if ( (CAPSState!=digitalRead(CAPSPin)) && !resetCapsLock) {
CAPSState = digitalRead(CAPSPin); // Remember new CAPSState. CAPSState = digitalRead(CAPSPin); // Remember new CAPSState.
Keyboard.set_key6(KEY_CAPS_LOCK); // Send KEY_CAPS_LOCK. Keyboard.set_key6(KEY_CAPS_LOCK); // Send KEY_CAPS_LOCK.
@ -230,7 +220,7 @@ void loop()
if ( resetCapsLock && (millis()-dTime) > 10) { if ( resetCapsLock && (millis()-dTime) > 10) {
Keyboard.set_key6(KEY_CAPS_UNLOCK); Keyboard.set_key6(KEY_CAPS_UNLOCK);
resetCapsLock = false; resetCapsLock = false;
} */ }
/*char CAPSState = digitalRead(CAPSPin); /*char CAPSState = digitalRead(CAPSPin);
if (CAPSState == LOW) { if (CAPSState == LOW) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

View File

@ -46,6 +46,12 @@ char keys[ROWS][COLS] = {
}; };
char Fkeys[2][10] = {
{KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0 },
{KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_F9, KEY_F10 }
};
/* /*
@ -142,15 +148,16 @@ void setup(){
pinMode(APPLEPin1, INPUT); pinMode(APPLEPin1, INPUT);
pinMode(APPLEPin2, INPUT); pinMode(APPLEPin2, INPUT);
digitalWrite(APPLEPin1, LOW); digitalWrite(APPLEPin1, LOW);
digitalWrite(APPLEPin2, LOW); digitalWrite(APPLEPin2, LOW);
digitalWrite(SHIFTPin, HIGH); digitalWrite(SHIFTPin, HIGH);
digitalWrite(CTRLPin, HIGH); digitalWrite(CTRLPin, HIGH);
pinMode(CAPSPin, INPUT); pinMode(CAPSPin, INPUT);
digitalWrite(CAPSPin, HIGH); digitalWrite(CAPSPin, HIGH);
} }
void loop() void loop()
@ -274,6 +281,7 @@ void loop()
//if( KPD.key[5].kchar && ( KPD.key[5].kstate==PRESSED || KPD.key[5].kstate==HOLD )) //if( KPD.key[5].kchar && ( KPD.key[5].kstate==PRESSED || KPD.key[5].kstate==HOLD ))
// Keyboard.set_key6( KPD.key[5].kchar ); // Keyboard.set_key6( KPD.key[5].kchar );
Keyboard.send_now(); Keyboard.send_now();
Keyboard.set_modifier(0); Keyboard.set_modifier(0);