Is it possible to have the Arduino measure frequency? I would guess using the pulsein() function should be the right course of action but what would be a sample code to measure the input frequency?
My project is a metal detector which changes from low to high frequencies when metal is found. I want to use the Arduino to set a threshold frequency which indicates 'No Metal' and anything above that frequency indicates 'Metal Detected.'
How would I use the pulsein() function to implement this?
I wish I could give you some more.. detailed information, but here's a member of LMR (Letsmakerobots.com) Who installed a metal detector on his robot, I'm not sure how he implemented it, only seen the pictures haven't read into it much!
Connect the input frequency to pin2, and 3 LEDs to pins 3,4 and 5;
LED at pin3 lights up if no frequency detected, LED at pin4 indicates a low frequency and LED at pin 5 indicates a high frequency.
Threshold determines what a low or high frequency is. A value of 500 gives a half period of 500 Microseconds (1000Hz) (supposed that the frequency is symmetrical);