Go Down

Topic: Help, Code for reading Frequency (Read 695 times) previous topic - next topic


Ok please forgive me, i am very noobish ... i actually need to ask a question but not sure how to start it as a topic like he did up there..

i need a simple program where i can read a frequency, no need to display it.
ill read it if its above 500hz an led light up,
and if its below 500hz another led from another pin light up.. of course i am not going to ask u guys to do this for me but i will try my self in the cod below... please forgive my obvious syntax error.

Code: [Select]
#include <FreqMeasure.h>
int led1=13;
int led2=9;
void setup() {

if (FreqMeasure.available()< 500)

will this work ?

just a clarification for the library , i got it from this site http://www.pjrc.com/teensy/td_libs_FreqMeasure.html#compare , and i place it in my libraries folder within the audrino upload, is this right ?


Need to put this part within void loop:
Code: [Select]

void loop(){
if (FreqMeasure.available()< 500){

} // end loop

and then add some logic to turn the LEDs off, other wise once on they will stay on.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up