The code was basically aimed at vibrating the sand off of a persons body after they had left the beach. What I accomplished was to make it so that it would use pwm to vibrate a material at various frequencies and take in the strength of that vibration and evaluate what frequencies the material vibrated with the most strength and use that as the resonant frequency.
This makes use of a Tessel board, a vibrating mini motor, and an electret microphone.
Shown are pictures of the setup attanched to a subway card and some of the data pulled by running the program. A clamp is used to attach the disk to the card, and although the clamp also vibrates it is the best method available for securing the disk. The program finds an amount of amibient noise in the room at first and attempts to disregard it while getting sound from the card only. The first steps 0 through 0.5 are the recording of the ambient noise i the room.
The electret microphone then picks up noise from around 25 steps of the program from 0.5 to 1 and ranks the highest amount of noise as the most likely possible resonant frequency. This may be prone to error if there is a spike of noise in the room.