For this Arduino project, I used the ultrasonic sensor with the LCD display to create a way to type with using only a single limb! (Or any large, blunt object) Perhaps for those who have lost a limb or fingers. In a situation such as this:
They could send text messages, or do any action that typically requires typing, albeit slowly!
The distance from the sensor determines what letter you’d like to type:
And then when you lift your arm/object, it will choose the currently selected letter to type! And then you can repeat this as many times as you’d like to type out words:
The code for this is a little awful
I define a bunch of functions for getting the range, defining a character for that range, ‘displaying’ a character (without selecting it) and ‘selecting’ a character
In my look, I take an average of 30 measurements, and remove any measurement that came out as 0 (which is the result if the distance is really far)
Then, we get a character from that distance by using the speed of sound. Each letter of the alphabet gets ~2cm of space.
If there’s a sudden change of greater than 30 centimeters from the average, it assumes that you took your hand away and the selects the “average” letter