-
-
Save hitherejoe/d0b4b5dfa4daa2c5f3e4c5852a577469 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import RPi.GPIO as GPIO | |
import braille_mapper | |
import time | |
def read_braille(braille_strings): | |
for sequence in braille_strings: | |
display_braille_sequence(sequence) | |
time.sleep(.400) | |
def display_braille_sequence(sequence): | |
braille = braille_mapper.convertTextToBraille(sequence)[0] | |
print(braille) | |
if (braille[0] == '1'): | |
GPIO.output(17,GPIO.LOW) | |
else: | |
GPIO.output(17,GPIO.HIGH) | |
if (braille[1] == '1'): | |
GPIO.output(27,GPIO.LOW) | |
else: | |
GPIO.output(27,GPIO.HIGH) | |
if (braille[2] == '1'): | |
GPIO.output(22,GPIO.LOW) | |
else: | |
GPIO.output(22,GPIO.HIGH) | |
if (braille[3] == '1'): | |
GPIO.output(23,GPIO.LOW) | |
else: | |
GPIO.output(23,GPIO.HIGH) | |
if (braille[4] == '1'): | |
GPIO.output(24,GPIO.LOW) | |
else: | |
GPIO.output(24,GPIO.HIGH) | |
if (braille[5] == '1'): | |
GPIO.output(25,GPIO.LOW) | |
else: | |
GPIO.output(25,GPIO.HIGH) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment