Skip to content

Instantly share code, notes, and snippets.

@hitherejoe hitherejoe/braille_reader.py Secret
Created Feb 11, 2019

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.