10-12-2012 04:43 PM - edited 10-12-2012 04:48 PM
Hi, Im working on my final project for an electronics class and Im making an automated guitar hero using labVIEW and vision builder. I already have all the buttons and the strum bar but I need help with the whammy bar. My problem is that it should only work on notes that take more time than just one click, I think I need to add some time delay (or something like that) so if the camera sees the the note more than x amount of time its going to send a signal to the solenoid to keep pressing the whammy bar in an intermittent form (I think I need a square wave for that part).
I will really appreciate if someone can help me or show me an example of how to implement that part.
Here is a video of a similar project without the whammy bar
edit: Im using a NI-cDAQ 9472 module for the digital output on a usb NI-cDAQ 9171 chasis
Thanks,
Javier Morales
Solved! Go to Solution.
10-15-2012 02:30 AM
Dear Javier,
That sounds like a cool project you are working on.
Why not try wiring the output of the shared variable into a shift register to retain the previous value(s) and compare the old with new value using an And gate. You can wire in a Wait function in your while loop and wire in abour 100ms, normal human reaction time, so that if the button has been held for two cycles this triggers your whammy bar.
I hope this helps.
Regards,
10-15-2012 02:45 AM
Javier, sounds like a cool project.
You should put the project on the NI Community.
https://decibel.ni.com/content/community/zone?view=documents
I am thinking about something similar, but with a self-playing pinball machine using machine vision. (as soon as I get my UAV airborne first )
Br,
/Roger
10-15-2012 12:00 PM
Thanks for you help Rob! your response helped me ALOT.
Instead of using a shift register I used a case structure (because I dont know how to use the shift register 🙂 ), wait and a AND gate for the first part. The output of the gate goes to the input of another AND gate, the other input is a square signal (to keep the whammy moving), and as far I've been testing it at home it works but I will have to try tomorrow in class to see if works with the DAQ.
10-15-2012 12:05 PM
Thanks Roger,
I will post it as soon as I finish , your project sonds awezome an self-playing pinball machine never thought about it sound like alot of fun.
Good luck with it
Javier Morales
10-15-2012 12:18 PM
@JavierMorales wrote:
Instead of using a shift register I used a case structure (because I dont know how to use the shift register 🙂 )
I would suggest learning how to use a shift register. They are powerful, and a basic LabVIEW concept. Imagine if you didn't know how to do
n = n + 1; in a text base language? This would be a serious limitation, and that is effectively what a shift register is doing! It stores a value from one loop iteration to the next.
10-16-2012 02:47 AM
Javier,
I am glad I could be of help. Like for(imstuck) I would recommend learning about shift registers. They are extremely useful functions in LabVIEW and made my life easier when I learned how they work - ideal for the task you just described.
Good luck with the rest of the project.
Regards,
10-16-2012 03:24 AM - edited 10-16-2012 03:25 AM
@Rob_Ward wrote:
Javier,
I am glad I could be of help. Like for(imstuck) I would recommend learning about shift registers. They are extremely useful functions in LabVIEW and made my life easier when I learned how they work - ideal for the task you just described.
Good luck with the rest of the project.
Regards,
Worth pointing out. If your VI have more than two shift registers, perhaps it's time to rearchitect the code. In too many cases I have seen insane LV code with a wicked amount of shift registers.
The same can be said about psuedo by-reference "popcorn-machine" implementations using the producer/consumer pattern and those imbecilles nuking an application with "(radio)active objects" until it is impossible to follow the logic and get a consistent performance of the application.
Br,
/Roger