12-03-2011 10:10 PM
I am taking a look at the Tone Example.vi example that ships with LIFA. The pulse is generated on pin 3 of the Arduino Uno, and this pin is connected to a scope. I set the frequency at 200 Hz, 500 Hz etc... and the square wave on the scope shows up as expected.
However, I do not see any changes on the signal when the "duration" control is changed... what is this control supposed to do ?
Thx.
Laurent
PS: I also altered the vi by only calling the Tone.vi only when a change on either Frequency, or Duration is detected. This drastically reduce the RX .TX operations between the PC and the Arduino
12-05-2011 10:02 AM
Laurent,
The frequency and duration are passed to the Tone function:
http://arduino.cc/en/Reference/Tone
-Sam K
LIFA Developer
12-05-2011 12:43 PM
Yes I can see it is passed to the tone input of the Tone function. But using the
VI example: Tone Example.vi, and looking at the signal on a scope, the duration input
seems to have no effect at all.
L.
12-07-2011 04:24 PM
Hey Laurent,
The duration input doesn't have an affect in the example because the VI calls the function over and over again in a loop. If you want the Tone VI to only execute for a certain amount of time you will need to take it outside of the loop. The duration input probably shouldn't be user-settable for this example since it is not going to have an affect.
12-07-2011 05:30 PM
Hi Kevin,
As I mentioned earlier Ialtered the vi by only calling the Tone.vi only when a change on either Frequency, or Duration is detected. So in effect the call to done is done once before a parameter change is done by the user, still the duration has no effect. The tone (square signal on my scope) does not end. I will double-check this, but I am pretty sure of the behavior now.
L.
12-07-2011 05:45 PM
Hey Laurent,
You are correct there is something goofy going on with the LIFA Tone call. Ill take a look at it more and see if I can figure out whats going on.
12-07-2011 05:51 PM
Ha ! .
By the way, my application actually does not need the pulse to stop. The tone.vi , with its quirk, is a nice easy way to generate an on-going pulse at variable frequencies.
However, fixing it may be useful in general.
L.
12-07-2011 06:00 PM
Allright I found our error. You can look forward to that fix coming up in the next firmware release.
Thanks for pointing this out.
12-07-2011 06:50 PM
By the sound of it, the error in the firmware? not the VI ?
L
12-08-2011 12:58 PM
The error was in the firmware (order of operations problem with the binary math)