08-23-2017 04:50 AM
Hello,
I am new to LabVIEW. I have had some success with blinking a LED and controlling LED based on cursor position.
However, I now want to control LED based on PWM. I know there are some PWM examples to control LED but they are not what I am looking for.
I would like to control LED based on the signal I have generated (please see the attached image). While the signal is high (at 5 in this case), the LED should turn on and while is signal is low (0 in this case), the LED should turn off.
I was able to obtain a 1D boolean array from the waveform but the LED accepts only Boolean but not an array. I am unable to understand this because I imagined that with an array, I will be able to turn on and off based on the signal. I intend to control the LED using an Arduino Uno.
Can someone please help?
Best regards,
Shashank
P.S: Attached sketch does not contain the Arduino part.
08-23-2017 05:37 AM - edited 08-23-2017 05:38 AM
If you are sure that your values will be 0 or 5 then use select switch if the value is 0 then provide FALSE to LED Indicator else TRUE to LED Indicator
08-23-2017 05:53 AM
you're almost there.. pass your Boolean array through for loop and attach to boolean
08-23-2017 05:55 AM
Dear Mr. Thiruvenkadam,
Thank you for your reply. I had tried to connect the waveform to a switch, but that ends up in an error: "You have connected two terminals of different types".
08-23-2017 06:11 AM
@bharathp10 wrote:
you're almost there.. pass your Boolean array through for loop and attach to boolean
Dear Bharathp10,
do you mean something like the attached image? It still doesn't work.
08-23-2017 06:18 AM - edited 08-23-2017 06:20 AM
Hi shasv,
a simple example how you could handle arrays:
Dear Bharathp10,
do you mean something like the attached image? It still doesn't work.
What's the point in connecting a waveform to the iteration count input of the FOR loop?
What's the point in analyzing the iteration counter to driver the LED - when you want to output this waveform???
08-23-2017 06:23 AM
Dear GerdW,
This is exactly what I was looking for. Please excuse my mistake with FOR loop. I do not have any background in programming.
Thank you very much.
Best,
Shashank
08-23-2017 06:53 AM
@GerdW wrote:
Hi shasv,
a simple example how you could handle arrays:
Dear GerdW,
I noticed that the LED blinking is erratic and is not according to the waveform. For example, at1 Hz and 50% duty cycle, the LED just keeps blinking with short moments where it is off. It is the same if I change to 20% duty cycle.
Do you observe the same behavior?
08-23-2017 07:39 AM
08-23-2017 08:23 AM
Hi GerdW,
Yes, I realized this through the 'highlight execution'. The LED actually follows the waveform, just that the timing is weird. I am trying to learn more about it.
Thank you very much for your responses.
Best regards,
Shashank