Using Haptics for Directional Hearing Part 5a: Results!
After a little bit of modification to both the circuit and the code, I HAVE RESULTS! This set up has the motor in the diagram responding to sounds. I think a little bit of calibration in the script will make it work spectacularly. I am officially at the tinkering step. I will give updates on the calibration as it goes on.
Here is the working diagram:

Microphone Test: SUCCESSFUL!
Here is the working code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
int vol = 0; int LED = 5; void setup() { // Set the LED pin to output, and start the Serial Comm. pinMode(LED, OUTPUT); Serial.begin(9600); } void loop() { // Read the volume and write it to the LED, and Serial for Debugging. vol = analogRead(A0); if (((vol/4)-99) < 0){ analogWrite(LED, 0); } else{ analogWrite(LED, (vol/3)-5); } Serial.println((vol/4)-16); } |
On second thought… Maybe I will make an adjustable calibrator for different situations…