We simulated a semaphore for blind people. The procedure is the following:
- The semaphore starts with red light.
- When someone press the button, semaphore changes to a green light, and the buzzer beeps.
- After 8 sec, the semaphore turns to a blinking yellow light, and the buzzer beeps faster. This indicates to the pedestrians that the semaphore is going to change to red.
- After 1.25 sec, the semaphore turns red and waits to the next pedestrian



#define NOTE_C3 131
const int ledRed = 13;
const int ledYellow = 12;
const int ledGreen = 8;
const int buttonPin = 2;
const int voz = 7;
int buttonState = 0; // variable for reading the pushbutton status
int on = 0;
void setup() {
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(ledRed , OUTPUT);
pinMode(ledYellow , OUTPUT);
pinMode(ledGreen , OUTPUT);
pinMode(voz , OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
//Serial.print(“Estado del boton”);
//Serial.println(buttonState);
digitalWrite(ledRed, HIGH);
if (buttonState == HIGH) {
delay(500);
digitalWrite(ledRed, LOW);
digitalWrite(ledGreen, HIGH);
int noteDuration = 1000/4;
for(int i=0;i<8;i++){
tone(voz, NOTE_C3,noteDuration);
delay(1000);
}
digitalWrite(ledGreen, LOW);
digitalWrite(ledYellow, HIGH);
tone(voz, NOTE_C3,noteDuration);
delay(250);
for(int i=0;i<5;i++){
digitalWrite(ledYellow, LOW);
delay(250);
digitalWrite(ledYellow, HIGH);
tone(voz, NOTE_C3,noteDuration);
delay(250);
}
digitalWrite(ledYellow, LOW);
}
}
Email me when Wild World of Wireless publishes stories
