document
This commit is contained in:
parent
ac0d4dff6c
commit
65068b7f5e
@ -47,10 +47,9 @@ The following install steps are modified from the [Teensyduino download page](ht
|
|||||||
|
|
||||||
For Linux:
|
For Linux:
|
||||||
|
|
||||||
1. Download and extract the Arduino software.
|
1. Download and extract the Arduino software to the /opt directory:
|
||||||
Move the extracted directory to /opt:
|
|
||||||
|
|
||||||
$ sudo mv ~/Downloads/arduino-1.6.7 /opt/arduino-1.6.7
|
/opt/arduino-1.x.x
|
||||||
|
|
||||||
2. The "Linux udev rules" link is at top right of page.
|
2. The "Linux udev rules" link is at top right of page.
|
||||||
Save the teensy.rules file in /etc/udev/rules.d/
|
Save the teensy.rules file in /etc/udev/rules.d/
|
||||||
@ -63,7 +62,7 @@ For Linux:
|
|||||||
|
|
||||||
Run the teensyduino installer and fill the form fields:
|
Run the teensyduino installer and fill the form fields:
|
||||||
|
|
||||||
Arduino location to install Teensyduino: /usr/local/bin/arduino-1.x.x
|
Arduino location to install Teensyduino: /opt/arduino-1.x.x
|
||||||
Libraries to Install: None
|
Libraries to Install: None
|
||||||
|
|
||||||
4. Launch Arduino IDE from /opt/arduino-1.x.x/arduino
|
4. Launch Arduino IDE from /opt/arduino-1.x.x/arduino
|
||||||
|
@ -38,28 +38,28 @@ void Code_LEDLock::release()
|
|||||||
Keyboard.release(scancode);
|
Keyboard.release(scancode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* updateLED() is a separate function from press() because Arduino boards may need a different implementation.
|
/* This comment is for Arduino board, because Arduino boards may need a different implementation.
|
||||||
updateLED() has been tested on teensy 2.0.
|
updateLED() has NOT been tested on an Arduino board.
|
||||||
The variable "keyboard_leds" is in /opt/arduino-1.6.7/hardware/teensy/avr/cores/usb_hid/usb.c
|
updateLED() has been tested on teensy 2.0 (not an Arduino board).
|
||||||
|
The variable "keyboard_leds" is in /opt/arduino-1.6.7/hardware/teensy/avr/cores/usb_hid/usb.c
|
||||||
// 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana
|
// 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana
|
||||||
https://forum.pjrc.com/threads/25368-How-do-I-receive-a-numlock-capslock-LED-signal-from-the-PC
|
https://forum.pjrc.com/threads/25368-How-do-I-receive-a-numlock-capslock-LED-signal-from-the-PC
|
||||||
updateLED() has NOT been tested on an Arduino board.
|
The word "keyboard_leds does not appear in "Arduino\hardware\arduino\cores\
|
||||||
The word "keyboard_leds does not appear in "Arduino\hardware\arduino\cores\
|
This shows how to hack KeyReport in Arduino: https://www.sparkfun.com/tutorials/337
|
||||||
This shows how to hack KeyReport in Arduino: https://www.sparkfun.com/tutorials/337
|
TMK firmware, which is not Arduino, uses variable "usb_led" instead of "keyboard_leds"
|
||||||
TMK firmware uses variable "usb_led" instead of "keyboard_leds"
|
|
||||||
http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html >usb_led
|
http://deskthority.net/workshop-f7/how-to-build-your-very-own-keyboard-firmware-t7177.html >usb_led
|
||||||
*/
|
*/
|
||||||
void Code_LEDLock::updateLED() const
|
void Code_LEDLock::updateLED() const
|
||||||
{
|
{
|
||||||
/* KEY_SCROLL_LOCK is not working on Teensy2.0, it prints keyboard_leds=0, maybe Linux doesn't have it.
|
/* KEY_SCROLL_LOCK is not working on Linux with Teensy2.0.
|
||||||
Here is the debug code:
|
This debug code prints "keyboard_leds=0" when scrollLock is pressed:
|
||||||
Keyboard.print(F(" keyboard_leds="));
|
Keyboard.print(F(" keyboard_leds="));
|
||||||
Keyboard.print(keyboard_leds);//KEY_NUM_LOCK:1, KEY_CAPS_LOCK:2, KEY_SCROLL_LOCK:0
|
Keyboard.print(keyboard_leds); //KEY_NUM_LOCK:1, KEY_CAPS_LOCK:2, KEY_SCROLL_LOCK:0
|
||||||
Keyboard.print(" ");
|
Keyboard.print(" ");
|
||||||
*/
|
*/
|
||||||
if (keyboard_leds & USB_LED_bit) //if LED status bit is set
|
if (keyboard_leds & USB_LED_bit) //if USB_LED_bit is set
|
||||||
{
|
{
|
||||||
refLED.off(); //LED on/off seem inverted, but it works
|
refLED.off(); //LED on/off seem inverted, but it works for active high
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ void StateLayers::lock(const uint8_t layer)
|
|||||||
lockedLayer = layer;
|
lockedLayer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
//could set LED indicator lights in setActiveLayer()
|
//Derived classes override setActiveLayer() to also set LED indicator lights.
|
||||||
void StateLayers::setActiveLayer(const uint8_t layer)
|
void StateLayers::setActiveLayer(const uint8_t layer)
|
||||||
{
|
{
|
||||||
activeLayer = layer;
|
activeLayer = layer;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <StateLayersInterface.h>
|
#include <StateLayersInterface.h>
|
||||||
//#include <LED.h>
|
|
||||||
|
|
||||||
/* basic StateLayers for keyboard.
|
/* basic StateLayers for keyboard.
|
||||||
When pressed, Code_Layer objects call StateLayers functions lock() or hold().
|
When pressed, Code_Layer objects call StateLayers functions lock() or hold().
|
||||||
|
Reference in New Issue
Block a user