– added code for the braillle style chord keyboard.
– added documentation photos – added notes describing background, materials and design choicesmain
@ -1,3 +1,11 @@
|
||||
# sylvotext-synth
|
||||
|
||||
A kind of input machine for collaborative writing with trees.
|
||||
A kind of input machine for collaborative writing with trees.
|
||||
|
||||
This is a series of experiments with a goal of more everyday interaction with trees.
|
||||
|
||||
It was written for an Olimexino-STM32 development board but it should be portable to anything arduino compatible that can do USB-HID devices.. Note, depending on your board, you might need to modify the USB-HID keyboard calls to suit.
|
||||
|
||||
Some [Lab Notes](sylvotext-lab-notes1.md)
|
||||
|
||||
![WIP Photo of Machine](photos/sylvotext1.jpg "WIP Image of a rustic maple 6-key chord keyboard")
|
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 4.6 MiB |
After Width: | Height: | Size: 4.5 MiB |
After Width: | Height: | Size: 3.2 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.2 MiB |
After Width: | Height: | Size: 3.4 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 3.3 MiB |
After Width: | Height: | Size: 4.6 MiB |
After Width: | Height: | Size: 4.5 MiB |
After Width: | Height: | Size: 1012 KiB |
@ -0,0 +1,149 @@
|
||||
#include <USBComposite.h>
|
||||
|
||||
int key_L1 = 4; // braille dot 1 - binary 32
|
||||
int key_L2 = 5; // dot 2 - binary 16
|
||||
int key_L3 = 6; // dot 3 - binary 8
|
||||
int key_R1 = 7; // dot 4 - binary 4
|
||||
int key_R2 = 8; // dot 5 - binary 2
|
||||
int key_R3 = 9; // dot 6 - binary 1
|
||||
|
||||
int key_SPACE = 10;
|
||||
int key_SHIFT = 11; // TODO: probably should support differentiation of L/R shift
|
||||
|
||||
/*
|
||||
the keyMap uses a braille alphabet (6-bit values) from ASCII Braille
|
||||
|
||||
// TODO: add other keyMaps for other braille or alternative
|
||||
// chording/encoding systems
|
||||
*/
|
||||
char keyMap[65];
|
||||
int lastKey = -1;
|
||||
|
||||
USBHID HID;
|
||||
HIDKeyboard Keyboard(HID);
|
||||
|
||||
void setup() {
|
||||
pinMode(key_L1, INPUT_PULLUP);
|
||||
pinMode(key_L2, INPUT_PULLUP);
|
||||
pinMode(key_L3, INPUT_PULLUP);
|
||||
pinMode(key_R1, INPUT_PULLUP);
|
||||
pinMode(key_R2, INPUT_PULLUP);
|
||||
pinMode(key_R3, INPUT_PULLUP);
|
||||
|
||||
// TODO: there is probably a more RAM-saving way to do this with #DEFINE or
|
||||
// similar preprocessor magic
|
||||
keyMap[0] = ' ';
|
||||
keyMap[0b100] = '@';
|
||||
keyMap[0b100000] = 'a';
|
||||
keyMap[0b110000] = 'b';
|
||||
keyMap[0b100100] = 'c';
|
||||
keyMap[0b100110] = 'd';
|
||||
keyMap[0b100010] = 'e';
|
||||
keyMap[0b110100] = 'f';
|
||||
keyMap[0b110110] = 'g';
|
||||
keyMap[0b110010] = 'h';
|
||||
keyMap[0b10100] = 'i';
|
||||
keyMap[0b10110] = 'j';
|
||||
keyMap[0b101000] = 'k';
|
||||
keyMap[0b111000] = 'l';
|
||||
keyMap[0b101100] = 'm';
|
||||
keyMap[0b101110] = 'n';
|
||||
keyMap[0b101010] = 'o';
|
||||
keyMap[0b111100] = 'p';
|
||||
keyMap[0b111110] = 'q';
|
||||
keyMap[0b111010] = 'r';
|
||||
keyMap[0b11100] = 's';
|
||||
keyMap[0b11110] = 't';
|
||||
keyMap[0b101001] = 'u';
|
||||
keyMap[0b111001] = 'v';
|
||||
keyMap[0b10111] = 'w';
|
||||
keyMap[0b101101] = 'x';
|
||||
keyMap[0b101111] = 'y';
|
||||
keyMap[0b101011] = 'z';
|
||||
keyMap[0b10101] = '[';
|
||||
keyMap[0b110011] = '\\';
|
||||
keyMap[0b110111] = ']';
|
||||
keyMap[0b110] = '^';
|
||||
keyMap[0b111] = '_';
|
||||
|
||||
keyMap[0b11101] = '!';
|
||||
keyMap[0b10] = '"';
|
||||
keyMap[0b1111] = '#';
|
||||
keyMap[0b110101] = '$';
|
||||
keyMap[0b100101] = '%';
|
||||
keyMap[0b111101] = '&';
|
||||
keyMap[0b1000] = '\'';
|
||||
keyMap[0b111011] = '(';
|
||||
keyMap[0b11111] = ')';
|
||||
keyMap[0b100001] = '*';
|
||||
keyMap[0b1101] = '+';
|
||||
keyMap[0b1] = ',';
|
||||
keyMap[0b1001] = '-';
|
||||
keyMap[0b101] = '.';
|
||||
keyMap[0b1100] = '/';
|
||||
keyMap[0b1011] = '0';
|
||||
keyMap[0b10000] = '1';
|
||||
keyMap[0b11000] = '2';
|
||||
keyMap[0b10010] = '3';
|
||||
keyMap[0b10011] = '4';
|
||||
keyMap[0b10001] = '5';
|
||||
keyMap[0b11010] = '6';
|
||||
keyMap[0b11011] = '7';
|
||||
keyMap[0b11001] = '8';
|
||||
keyMap[0b1010] = '9';
|
||||
keyMap[0b100011] = ':';
|
||||
keyMap[0b11] = ';';
|
||||
keyMap[0b110001] = '<';
|
||||
keyMap[0b111111] = '=';
|
||||
keyMap[0b1110] = '>';
|
||||
keyMap[0b100111] = '?';
|
||||
|
||||
|
||||
HID.begin(HID_KEYBOARD);
|
||||
while (!USBComposite);
|
||||
Keyboard.begin();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
int key = -1;
|
||||
|
||||
if (digitalRead(key_L1) == LOW) {
|
||||
key += 32;
|
||||
}
|
||||
if (digitalRead(key_L2) == LOW) {
|
||||
key += 16;
|
||||
}
|
||||
if (digitalRead(key_L3) == LOW) {
|
||||
key += 8;
|
||||
}
|
||||
if (digitalRead(key_R1) == LOW) {
|
||||
key += 4;
|
||||
}
|
||||
if (digitalRead(key_R2) == LOW) {
|
||||
key += 2;
|
||||
}
|
||||
if (digitalRead(key_R3) == LOW) {
|
||||
key += 1;
|
||||
}
|
||||
|
||||
if (digitalRead(key_SPACE) == LOW) {
|
||||
key = 0;
|
||||
}
|
||||
|
||||
if ((key != lastKey) && (key != -1)) {
|
||||
|
||||
char key_out = keyMap[key];
|
||||
|
||||
// check for shift
|
||||
// TODO: either use STD::TOUPPER or make this more proper for extended chars
|
||||
if (digitalRead(key_SHIFT) == LOW) {
|
||||
key_out &= ~' ';
|
||||
}
|
||||
|
||||
// TODO: send proper keydown and keyup so key-repeat works on OS level.
|
||||
Keyboard.print(key_out);
|
||||
}
|
||||
|
||||
lastKey = key;
|
||||
delay(100);
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
## Lab Notes for Sylvotext KB#1
|
||||
|
||||
This is the first in a series of experiment to try to make real working machines that integrate trees into daily life. These works my seem to be speculative (and they are certainly experimental) but they are earnestly intended for real everyday use.
|
||||
|
||||
It is also an attempt at what some people are calling "Perma-Computing", an approach to digital technologies inspired by de-growth, more natural temporalities as well as social and ecological justice.
|
||||
|
||||
One might say that there is a sad irony that when we use digital technologies, we use objects that were made under conditions of extractivism and exploitation
|