Hackster is hosting Hackster Holidays, Ep. 6: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Monday!Stream Hackster Holidays, Ep. 6 on Monday!
Shahariar
Published © CC BY

Braille Trainer Board: Learning Dots with Auditory Feedback

Learning the Braille Dots representing 26 English Alphabets with Audio Feedback for Visually Impaired Children

IntermediateFull instructions provided12 hours156

Things used in this project

Hardware components

Spresense boards (main & extension)
Sony Spresense boards (main & extension)
×1
Gravity:Digital Push Button (Yellow)
DFRobot Gravity:Digital Push Button (Yellow)
×26
Stereo Enclosed Speaker - 3W 8Ω
DFRobot Stereo Enclosed Speaker - 3W 8Ω
×1
Flash Memory Card, MicroSD Card
Flash Memory Card, MicroSD Card
×1
Headphones, 20 Hz
Headphones, 20 Hz
×1
Male/Female Jumper Wires
Male/Female Jumper Wires
×20
Polymer Lithium Ion Battery - 2200mAh 3.7V
Seeed Studio Polymer Lithium Ion Battery - 2200mAh 3.7V
×1
Rocker Switch, VISI-ROCKER
Rocker Switch, VISI-ROCKER
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

A to Z mp3

extract and copy to the root directory of the microSD card
then insert the card into Sony extension board

Schematics

Schematic wiring style

Code

FeelTheDotsBraille

Arduino
#include <SDHCI.h>
#include <Audio.h>
#include <Keypad.h>



const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns

//define the cymbols on the buttons of the keypads
char hexaKeys1[ROWS][COLS] = 
{
  {'A','B','C','D'},
  {'E','F','G','H'},
  {'I','J','K','L'},
  {'M','N','O','P'}
};


const byte ROWS2 = 2; // two rows
const byte COLS2 = 5; //five columns


char hexaKeys2[ROWS2][COLS2] = 
{
  {'Q','R','S','T','U'},
  {'V','W','X','Y','Z'}

};


byte rowPins1[ROWS] = {3, 2, 1, 0}; //connect to the row pinouts of the keypad1
byte colPins1[COLS] = {7, 6, 5, 4}; //connect to the column pinouts of the keypad1

byte rowPins2[ROWS2] = {14, 15};       //connect to the row pinouts of the keypad2
byte colPins2[COLS2] = {8,9,10,11,12}; //connect to the col pinouts of the keypad2


//initialize an instance of class NewKeypad
Keypad customKeypad1 = Keypad( makeKeymap(hexaKeys1), rowPins1, colPins1, ROWS, COLS); 
Keypad customKeypad2 = Keypad( makeKeymap(hexaKeys2), rowPins2, colPins2, ROWS2, COLS2); 


// init SD card with mp3 files and audio playback library

SDClass theSD;
AudioClass *theAudio;

File myFile;
bool ErrEnd = false;
static void audio_attention_cb(const ErrorAttentionParam *atprm)
{  
  if (atprm->error_code >= AS_ATTENTION_CODE_WARNING)
    {
      ErrEnd = true;
   }
}


void setup(){
    while (!theSD.begin())
    {
    }

  // start audio system
  theAudio = AudioClass::getInstance();
  theAudio->begin(audio_attention_cb);
  puts("initialization Audio Library");

  /* Set clock mode to normal */
  theAudio->setRenderingClockMode(AS_CLKMODE_NORMAL);
  theAudio->setPlayerMode(AS_SETPLAYER_OUTPUTDEVICE_SPHP, AS_SP_DRV_MODE_LINEOUT);

}
  

void loop()
{
  err_t err = theAudio->initPlayer(AudioClass::Player0, AS_CODECTYPE_MP3, "/mnt/sd0/BIN", AS_SAMPLINGRATE_AUTO, AS_CHANNEL_STEREO);

  char customKey1 = customKeypad1.getKey();
  char customKey2 = customKeypad2.getKey();
  
  if (customKey1)
  {
  myFile = theSD.open(String(customKey1)+".mp3");
  err = theAudio->writeFrames(AudioClass::Player0, myFile);
  theAudio->startPlayer(AudioClass::Player0);
  theAudio->setVolume(-120);
  theAudio->startPlayer(AudioClass::Player0);
  delay(1000);
  theAudio->stopPlayer(AudioClass::Player0);
  myFile.close();
  }

  if (customKey2)
  {

  myFile = theSD.open(String(customKey2)+".mp3");
  err = theAudio->writeFrames(AudioClass::Player0, myFile);
  theAudio->startPlayer(AudioClass::Player0);
  theAudio->setVolume(-120);
  theAudio->startPlayer(AudioClass::Player0);
  delay(1000);
  theAudio->stopPlayer(AudioClass::Player0);
  myFile.close();
  }
/*
  int error = theAudio->writeFrames(AudioClass::Player0, myFile);

  if (error)
    {
      goto stop_player;
    }

  if (ErrEnd)
    { 
     goto stop_player;
    }


  usleep(40000);


  return;

stop_player:
  theAudio->stopPlayer(AudioClass::Player0);
  myFile.close();
  theAudio->setReadyMode();
  theAudio->end();
  exit(1);
*/
}

Credits

Shahariar

Shahariar

74 projects • 266 followers
"What Kills a 'Great life' is a 'Good Life', which is Living a Life Inside While Loop"

Comments