#include <NewPing.h>
#define MAX_DISTANCE 50
// Maximum distance we want to ping for (in
centimeters). Maximum sensor distance is rated at 400-500cm.
int PLAY_button=3;
int BIT_0=7;
int BIT_1=6;
void setup() {
Serial.begin(9600); // Open serial monitor at 115200 baud to see ping results.
pinMode(BIT_0,OUTPUT);
pinMode(BIT_1,OUTPUT);
digitalWrite(BIT_0,HIGH);
digitalWrite(BIT_1,HIGH);
pinMode(PLAY_button,INPUT);
circuit
pinMode(RESET_button,INPUT);
audio circuit
void loop() {
{ delay(50);
// Wait 50ms between pings (about 20 pings/sec). 29ms
should be the shortest delay between pings.
unsigned int uS = sonar.ping(); // Send ping, get ping time in microseconds (uS).
int MEASURED_OBSTRUCTION_LEFTSONAR=uS/ US_ROUNDTRIP_CM; //
Computation for the
delay(50);
// Wait 50ms between pings (about 20 pings/sec). 29ms should
be the shortest delay between pings.
unsigned int uS2 = sonar2.ping(); // Send ping, get ping time in microseconds (uS).
int MEASURED_OBSTRUCTION_RIGHTSONAR=uS2/ US_ROUNDTRIP_CM;
if
((MEASURED_OBSTRUCTION_LEFTSONAR>0)&&(MEASURED_OBSTRUCTIO
N_RIGHTSONAR>0))
{
digitalWrite(BIT_0,HIGH);
digitalWrite(BIT_1,HIGH);
digitalWrite(PLAY_button,HIGH);
delay(800);
digitalWrite(PLAY_button,LOW);
delay(100);
digitalWrite(RESET_button,HIGH);
delay(800);
digitalWrite(RESET_button,LOW);
delay(100);
//move right
if
((MEASURED_OBSTRUCTION_LEFTSONAR>0)&&(MEASURED_OBSTRUCTIO
N_RIGHTSONAR==0))
{
digitalWrite(BIT_0,LOW);
digitalWrite(BIT_1,HIGH);
digitalWrite(PLAY_button,HIGH);
delay(800);
digitalWrite(PLAY_button,LOW);
delay(100);
digitalWrite(RESET_button,HIGH);
delay(500);
digitalWrite(RESET_button,LOW);
delay(100);
}
//move left
if
((MEASURED_OBSTRUCTION_RIGHTSONAR>0)&&(MEASURED_OBSTRUCTI
ON_LEFTSONAR==0))
{
digitalWrite(BIT_0,HIGH);
digitalWrite(BIT_1,LOW);
digitalWrite(PLAY_button,HIGH);
delay(800);
digitalWrite(PLAY_button,LOW);
delay(100);
digitalWrite(RESET_button,HIGH);
delay(500);
digitalWrite(RESET_button,LOW);
delay(100);
Serial.print("Ping: ");
Serial.print(MEASURED_OBSTRUCTION_LEFTSONAR); // Convert ping time to
distance in cm and print result (0 = outside set distance range)
Serial.println("cm");
Serial.print("Ping2: ");
Serial.print(MEASURED_OBSTRUCTION_RIGHTSONAR); // Convert ping time to
distance in cm and print result (0 = outside set distance range)
Serial.println("cm");}
APPENDIX G
PAMANTASAN NG LUNGSOD NG MAYNILA
(University of the City of Manila)
Intramuros, Manila
Obstacle Detector Microcontroller Based Belt via Ultrasonic Sensors With Voice Command
For Level Surface Indoor Direction Instruction
For Legally Blind People
QUESTIONNAIRE
Gender:
1. Passing through the set-up maze while wearing a blind fold mask, does the device help
you make it
through?________________________________________________________________
________________________________________________________________________
________________________
________________________________________________________________________
____________
2. How do you feel using the device to navigate inside the maze? Is it easy or hard?
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
____________________________________
3. Having experience in using the device, do you think it will help the blind people to
navigate?
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
____________________________________