edison science corner
Published © CC BY

Voice-Assisted Wheel Chair for Visually Impaired Persons

A Voice-Assisted Wheel Chair for Visually Impaired Persons

BeginnerFull instructions provided10 hours47
Voice-Assisted Wheel Chair for Visually Impaired Persons

Things used in this project

Story

Read more

Custom parts and enclosures

3d printing files

Sketchfab still processing.

Schematics

circuit digram

Code

code

C/C++
#include "DFRobot_DF2301Q.h"
DFRobot_DF2301Q_I2C asr;
#include <FastLED.h>
#define NUM_LEDS 2
#define DATA_PIN 0
CRGB leds[NUM_LEDS];
#define IN_1  2                
#define IN_2  14               
#define IN_3  13                
#define IN_4  12   

void setup() {
  Serial.begin(115200);
  while (!(asr.begin())) {
    Serial.println("Communication with device failed, please check connection");
    delay(3000);
   FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); 
 pinMode(IN_1, OUTPUT);
 pinMode(IN_2, OUTPUT);
 pinMode(IN_3, OUTPUT);
 pinMode(IN_4, OUTPUT); 
  }
  Serial.println("Begin ok!");
  asr.setVolume(10);
  asr.setMuteMode(0);
  asr.setWakeTime(100);
  uint8_t wakeTime = 0;
  wakeTime = asr.getWakeTime();
  Serial.print("wakeTime = ");
  Serial.println(wakeTime);
}
void loop() {
 int flooor= analogRead(A0);
  uint8_t CMDID = asr.getCMDID();
  if ((CMDID == 22) && (flooor<500))
  {      Serial.println("22") ;                             
       goAhead();                           
       }
       if ((CMDID == 6) && (flooor<500))
  {      Serial.println("6") ;                             
       goRight();                           
       }
        if ((CMDID == 7) && (flooor<500))
  {      Serial.println("7") ;                             
       goLeft();                           
       }
       if ((CMDID == 8)||(flooor>1000))
  {      Serial.println("8") ;                             
       goBack();                           
       }
  delay(300);

}


void goAhead(){ 

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
     

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
      leds[0] = CRGB::Magenta;
  leds[1] = CRGB::Magenta;
  FastLED.show();
  delay(50);
     
  }

void goBack(){ 

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, LOW);
    

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, LOW);
       leds[0] = CRGB::Cyan;
  leds[1] = CRGB::Cyan;
  FastLED.show();
  delay(50); 
  }

void goRight(){ 

      digitalWrite(IN_1, HIGH);
      digitalWrite(IN_2, LOW);
     

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, HIGH);
         leds[0] = CRGB::Green;
  leds[1] = CRGB::Green;
  FastLED.show();
  delay(50); 
  }

void goLeft(){

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, HIGH);
      

      digitalWrite(IN_3, HIGH);
      digitalWrite(IN_4, LOW);
          leds[0] = CRGB::Blue;
  leds[1] = CRGB::Blue;
  FastLED.show();
  delay(50); 
      
  }


void stopRobot(){  

      digitalWrite(IN_1, LOW);
      digitalWrite(IN_2, LOW);
      

      digitalWrite(IN_3, LOW);
      digitalWrite(IN_4, LOW);
          leds[0] = CRGB::Red;
  leds[1] = CRGB::Red;
  FastLED.show();
  delay(50); 
     
 }

Credits

edison science corner

edison science corner

57 projects • 69 followers
Electronic enthusiast watch videos from here https://www.youtube.com/channel/UCVcOsUBmH4hzVSnmJA_i5SA

Comments