Haptic Feedback device for the Visually Impaired [Project HALO] by polymythic
Contest WinnerFeatured

Step 6: Creating the Software

Being a software engineer, I spent a lot of my time on the software aspect of this project. My source code is available. I used Caleb Zulawski's Ping Library (http://www.arduino.cc/playground/Code/Ping). I did make one modification, however. This library uses a default timeout of the pulseIn() function of 1 second. This was causing large delays in the execution of the program so I reduced this timeout to 500ms. Things execute far faster now. I will not go into the details of the program, because not all user of Instructables are code-jockeys, but here are the main points:

Source Code (Arduino Sketch and modified Ping library) are at  http://polymythic.com/HALO_SourceCode_v8.zip

The flow of the main program loop() is:
- Fire sensor,
- Check to see if any of the motors are supposed to turn on or off based on previous range finding
- Fire next sensor.. Repeat

Other Things to Note As You Look At The Code:
There are 4 "intensities" of motor pulsing to give the person a better sense of the range, and these vary by the foot (up to 4 feet)
This is based on an state-machine model, but one of the Arduino threading libraries could be used to handle this independently.
 
Remove these adsRemove these ads by Signing Up
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!