08-22-2009 10:32 PM
I'm trying to make a metronome application. This is my first real? labview app so it might look kind of funny. I think it works for the most part but I'm not entirely sure how accurate it is. Even if the timing is correct I seem to be losing accuracy somwhere. I tried to comment as much as possible.
Any ideas or suggestions? Thanks for everyones help.
Seth
08-22-2009 11:35 PM
I think you are going about your lower loop the wrong way. First, the inner while loop will run infinitely fast eating up CPU cycles. Second, the timing of the lower loop will be affected by the time it takes the person to clap along with the other code in that loop. There is no synchronization between the upper loop and lower loop.
I think you should use an event structure to detect when the person hits the clap button. I would use perhaps either a notifier or rendezvous to help synchronize the code between the upper and lower loops. Perhaps capture the millisecond timer up top when the ding is sent and capture the millisecond timer down bottom in the event structure when the person hits the clap button. Pass one to the other (notifier, single element queue, ) and compare the values.
08-23-2009 10:06 AM