A project for learning braille using FSR pt.2

Hello again!, Can anyone help me in translating different combinations of 6 FSR's (Each FSR corresponds to one of the individual blacked dots in the braille alphabet) into each corresponding letter of the alphabet (Text only). I'm having a hard time translating each combination into letters. Thank you

Hello johnbernardcristobal

Post your sketch, well formated, with well-tempered comments and in so called
code tags "< code >" and a schematic to see how we can help.

Have a nice day and enjoy coding in C++.

int pressureAnalogPins[] = {0, 4, 5}; // Pins where our pressure pads are located
int numPressureAnalogPins = 3; // Number of pressure analog pins
int pressureReading; // Variable for storing our reading

// Adjust these if required.
int noPressure = 2; // Max value for no pressure on the pad
int lightPressure = 50; // Max value for light pressure on the pad
int mediumPressure = 100; // Max value for medium pressure on the pad
 
void setup(void) {
  Serial.begin(9600);
}
 
void loop(void) {
  for (int i = 0; i < numPressureAnalogPins; i++) {
    int currentPressureAnalogPin = pressureAnalogPins[i];
    pressureReading = analogRead(currentPressureAnalogPin);
    
    Serial.print("Pressure Pad ");
    Serial.print(i + 1);
    Serial.print(" Reading = ");
    Serial.println(pressureReading);

    if (pressureReading < noPressure) {
      Serial.println(" - No pressure");
    } else if (pressureReading < lightPressure) {
      Serial.println(" - Light Pressure");
    } else if (pressureReading < mediumPressure) {
      Serial.println(" - Medium Pressure");
    } else {
      Serial.println(" - High Pressure");
    }
    delay(500);
  }
}

sorry if i misunderstood your instructions, im only new to robotics and stuff. It only creates an output for the pressure of each FSR. Additionally, i don't know how to create the hardware for translating the outputs of each fsr into letters.

do you have 3 or 6 pads?

Hello johnbernardcristobal

Show a picture of the mechanical interface between FSR and braille system.

i got 6 fsr pads each connected from what i think is called analog pins 0-5

You could create an array of structs representing the pads arrangement an matching letter

(I let you fill in the bit representation so you need to replace all the 0bxxxxxx


/*
  bits of the dots are arranged as such in the Braille struct
   0 3 
   1 4
   2 5
*/

struct Braille {
    uint8_t dots; // 6 dots represented in LSB 0-5 vertically (bit 0 is top left)
    char letter;
};

const Braille braille_alphabet[] = {
    {0b000001, 'A'}, // ⠁
    {0b000011, 'B'}, // ⠃
    {0bxxxxxx, 'C'}, // ⠉
    {0bxxxxxx, 'D'}, // ⠙
    {0bxxxxxx, 'E'}, // ⠑
    {0bxxxxxx, 'F'}, // ⠋
    {0bxxxxxx, 'G'}, // ⠛
    {0bxxxxxx, 'H'}, // ⠓
    {0bxxxxxx, 'I'}, // ⠊
    {0bxxxxxx, 'J'}, // ⠚
    {0bxxxxxx, 'K'}, // ⠅
    {0bxxxxxx, 'L'}, // ⠇
    {0bxxxxxx, 'M'}, // ⠍
    {0bxxxxxx, 'N'}, // ⠝
    {0bxxxxxx, 'O'}, // ⠕
    {0bxxxxxx, 'P'}, // ⠏
    {0bxxxxxx, 'Q'}, // ⠟
    {0bxxxxxx, 'R'}, // ⠗
    {0bxxxxxx, 'S'}, // ⠎
    {0bxxxxxx, 'T'}, // ⠞
    {0bxxxxxx, 'U'}, // ⠥
    {0bxxxxxx, 'V'}, // ⠧
    {0bxxxxxx, 'W'}, // ⠺
    {0bxxxxxx, 'X'}, // ⠭
    {0bxxxxxx, 'Y'}, // ⠽
    {0b110101, 'Z'}, // ⠵
};

you read the pads and build a byte in the same order using bit manipulations macros bitSet() when the sensor is activated and then walk the array to find a match

3 Likes

I would assign a binary number position to each dot. This would take only 6 binary bits.

For instance if the locations are numbered:

1 2
3 4
5 6

Then V would be
123456 <- only for ease of counting positions
101011

O would be:
123456
100110

etc

Smart ;)…

Hello, how would i input these binary numbers into the code given by @J-M-L ? do i simply replace the 0bxxxxxx? thank you

That’s what I suggested - just a different order for the pads (in case you had only a vertical reader with 3 sensors)

Each dot is a one and a space is a zero

1 Like
  {0b100110, 'O',

  {0b101011, 'V'},
etc

My intention is to map the pins to a binary position. Where @J-M-L Suggested assigning sequential numbers to the alphabet.
Not sure if either has a benefit over the other.

1 Like

got it, thank you so much

Nope… read again my proposal

You might have been confused because A and B have one dot and then two dots.

The vertical numbering is common - see Braille Alphabet - Braille Works

Wasn't confused, I just assumed a different "pinout" than you.

Ok.. then I ma confused by what you think my proposal was.. there was no sequential number in my proposal

@JohnRob @J-M-L Both are valid. Flip a bitcoin and go with one.

You are likely correct. I was thinking there may be a way to make the "decoding" easier / faster depending on how there were defined. However with a little google I read some combination of letters have different patterns. So I stopped thinking about it.

Sure it was the same suggestion, just different bit ordering . Hence why I’m confused.

Anyway no big deal