LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help on automated guitar hero using labview

Solved!
Go to solution

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

 

 

0 Kudos
Message 1 of 8
(3,602 Views)
Solution
Accepted by topic author JavierMorales

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,

Robert Ward
Applications Engineer, NI
0 Kudos
Message 2 of 8
(3,564 Views)

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 Smiley LOL)

 

Br,

 

/Roger

 

0 Kudos
Message 3 of 8
(3,559 Views)

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.

 

 

0 Kudos
Message 4 of 8
(3,528 Views)

Thanks Roger, 

 

I will post it as soon as I finish Smiley Wink, your project sonds awezome an self-playing pinball machine never thought about it sound like alot of fun.

 

Good luck with it Smiley Happy

 

Javier Morales 

0 Kudos
Message 5 of 8
(3,525 Views)

@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.

0 Kudos
Message 6 of 8
(3,520 Views)

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,

Robert Ward
Applications Engineer, NI
0 Kudos
Message 7 of 8
(3,488 Views)

@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

 

0 Kudos
Message 8 of 8
(3,483 Views)