Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Using digital output as LED dimmer on USB 6008

Hello all,

 

I am not sure if this is the correct place to post this, but it seemed most relevant.

 

On the USB 6008 device there is apparently only one counter. I am going to dim more than one LED, and because of that I want to use a digital output. To do the dimming i want to adjust the duty cycle. My question is this: Can i create a task to perform this for me, or do I need to write a scalar bit to the output 1000 times each second? (I plan on using 1kHz on the LED)

 

I have tried the following:

 

1. Create a task

2. Create the DO channel, with a single line attached to the taskhandle.

3. Configure timings

4. Write the buffer with the "duty cycle" for example duty cycle of 80 leads to a buffer with 80 values being 1, and 20 being 0. 

5. Start the task. 

 

Is there any point for me to keep trying to set up a task to do this, am I on the correct track? Or should I just jump directly to the software solution? (I have limited knowledge in the field of electronics, which might be the reason I have overlooked some easy solution.) 

 

I am using the C API provided by NI for this. 

 

Thanks for any answer. 

 

Sincerily,

BrokenTomato

0 Kudos
Message 1 of 1
(5,457 Views)