// DIO Braille sequencer version 2 - for use with Braille Key (LEDs represent plungers)
// https://forum.arduino.cc/t/using-arduino-and-shift-register-74hc595-for-braille-project/1373221/
#define MONITO 0 // use defined array of characters
// #define MONITOR 1 // use serial monitor for input
char helloWorld[] = "HELLO WOKWI";
int helloWorldSize = sizeof(helloWorld) / sizeof(helloWorld[0]);
byte ledPin[] = {11, 10, 9, 3, 4, 5}; // pins
int ledCount = sizeof(ledPin) / sizeof(ledPin[0]); // number of pins
int playbackRate = 250;
int alphanu[] = {
//A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1, 3, 9, 25, 17, 11, 27, 19, 10, 26, 5, 7, 13, 29, 21, 15, 31, 23, 14, 30, 37, 39, 58, 45, 61, 53,
// Number follows 111100 (60)
60,
// 1/A 2/B 3/C 4/D 5/E 6/F 7/F 8/G 9/H 10/I
1, 3, 9, 25, 17, 11, 27, 19, 10, 26
};
void setup() {
Serial.begin(115200); // start serial communications
for (int i = 0; i < ledCount; i++) // count through LED pins
pinMode(ledPin[i], OUTPUT); // configure pins for OUTPUT
}
void loop() {
for (int letter = 0; letter < helloWorldSize-1; letter++) {
Serial.print(helloWorld[letter]);
int letnumVal = helloWorld[letter] - 65;
for (int i = 0; i < 6; i++)
digitalWrite(ledPin[i], bitRead(alphanu[letnumVal], i));
delay(playbackRate);
for (int i = 0; i < 6; i++)
digitalWrite(ledPin[i], LOW);
delay(playbackRate);
}
Serial.println();
delay(2000);
}
/*
POSITIONS - in columns, left to right
1 oo 4
2 oo 5
3 oo 6
BITS - right to left positions 654321 (decimal equivalent)
A 000001 ( 1) F 001011 (11) K 000101 ( 5) P 001111 (15) U 100101 (37) Z 110101 (53)
B 000011 ( 3) G 011011 (27) L 000111 (17) Q 011111 (31) V 100111 (39)
C 001001 ( 9) H 010011 (19) M 001101 (13) R 010111 (23) W 111010 (58)
D 011001 (25) I 001010 (10) N 011101 (29) S 001110 (14) X 101101 (45)
E 010001 (17) J 011010 (26) O 010101 (21) T 011110 (30) Y 111101 (61)
Number follows 111100 (60)
0 011010 (26/J) 1 000001 ( 1/A) 2 000011 ( 3/B) 3 001001 ( 9/C) 4 011001 (25/D)
5 010001 (17/E) 6 001011 (11/F) 7 011011 (27/G) 8 010011 (19/H) 9 001010 (10/I)
Number follows 111100 Capital follows 100000
period 110010 comma 000010
colon 010010 apostrophe 000100
question 100110 asterisk/mult 010100
slash/div 001100 equal 110110
exclamation 010110 parenthesis 110110
plus 010110 minus 010010
openquote 100110 closequote 110100
*/
1
2
3
4
5
6
Learn Braille Characters