02-03-2016 05:52 AM
Hello all,
I have made a way to control not only the brightness of the onboard myRIO LEDs, but to control their brightness using PWM as well.
I have attached the FPGA VI for the myRIO- it might need to be compiled.
Suggestions are welcome!
Solved! Go to Solution.
02-03-2016 08:22 AM
I think your VI could be significantly simplified! I guess this was a learning exercise for you and you're looking for some feedback?
1) You can remove the local variables (which use up FPGA fabric) and just wire the brightness control to the Wait(uSec) directly - branch the wire into each one.
2) Having a 'stop' button on FPGA code doesn't really make any sense...you would always want the code to continue running...otherwise you would need to reset the FPGA (which is in contrast to programming in windows where you always want to stop the loop gracefully rather than aborting it - remember that an FPGA is essentially an electronic circuit when compiled)
3) Why do you have the additional sequences with a 1uSec wait in? You could just have "turn on" -> "wait" -> "turn off" -> "wait".
4) Having 4 loops for dimming some LEDs seems like unnecessarily repeated code...if you wanted to get really clever I'm sure you could simplify the code down to a single loop!
02-11-2016 04:26 AM
Hi Sam,
Thanks for giving a detailed reply to my post.
I have implemented two of your suggestions- #1 and #3.
But I didn't understand #2 and #4.
By "Having a 'stop' button on FPGA code doesn't really make any sense...you would always want the code to continue running..." do you mean that I should directly close the window without stopping it?
Can you please elaborate on what to do?
Thanks,
Shlok
02-11-2016 05:01 AM