hello
i want to store five var from 5 sensors .
i want to execute the following program if
sensor 1 = 1000
sensor 2 = 1200
sensor 3 = 1500
sensor 4 = 4000
sensor 5 = 5750
i need help
merci
kaïss
hello
i want to store five var from 5 sensors .
i want to execute the following program if
sensor 1 = 1000
sensor 2 = 1200
sensor 3 = 1500
sensor 4 = 4000
sensor 5 = 5750
i need help
merci
kaïss
i want to store five var from 5 sensors .
You store values, not variables.
Do you want to store 5 values from each of 5 sensors? Or one value from each of 5 sensors?
What kind of sensors? Connected to which pins? Store the data where? Persistent over resets?
i want to execute the following program
There is no "following program", and it seems unlikely that you will get a reading of 4000 or 5750 from any sensor you connect to the Arduino.
hello thanks for your answer
i want to compare fréquency from D0
if first frequency from d0 is 1200 and the others (from d0) are 1200 then 1500 then 4000 and then 5750 ,
i turn on a LED
thanks
if first frequency from d0 is 1200 and the others (from d0)
I might be missing something here, but it appears that you want to connect 5 things to one pin, and somehow guess which one you are reading from at any point in time.
D0 is input than receive audio signal
in the same input i want to detect 5 frequency .
if the 5 five frequency are in this sequence : 1000Hz 1200Hz 1500Hz 4000Hz 5750Hz , I turn on the led
thanks
sorry for my english
D0 is input than receive audio signal
Reading an audio frequency on a digital pin doesn't make sense. Even if it did, you don't get frequency from one reading. So, you can't compare 5 consecutive readings, to see if you got that collection of values.
sorry , the input is A0.
thanks
kaiss:
sorry , the input is A0.thanks
Well, that's better. You still need to take a bunch of readings, to find two subsequent peaks so you can measure the frequency.
What is supplying the signal being measured? How long does each signal stay at a given frequency?
each signal stay 100ms , i can measure the frequencies, it is not a probleme for me .
i don t know how i can do to write this condition :
i want to turn on a led if these frequency are in this order .
thanks
i can measure the frequencies, it is not a probleme for me .
So, you know freq[0], freq[1], freq[2], freq[3], and freq[4]. But you can't figure out how to compare that array to some other array in memory?
Perhaps memcmp() would be useful.