Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Emitter detector

In order to calculate the transparency of a liquid, I have an RGB LED and a light dependant resistor either side of some clear tubing inside a clamshell to trap all the light inside.

 

In my VI, I flash the light 100 x times and read the data from the LDR and put it into High Array. I then read the data 100 times with the LED turned OFF and enter this into Low Array. The data from High array is put into a 'LED ON Graph', and the data from Low array is put into 'LED OFF Graph'. Below is an example of my results.

 

EdwinStar_0-1683198386330.png

Does anyone know why my data from the 'LED ON' tends to the value that it reads when the value is OFF. Is there a better way of doing this to get a flat horizontal line for 'LED ON' Vales.

 

Thank you

 

 

Download All
0 Kudos
Message 1 of 3
(709 Views)

Hi

When looking at your code I see a for loop that runs 100 times and only when the loop counter is 1 it fills the lower array.

 

Is that what you want? All other times it fills the higher array.

greetings from the Netherlands
0 Kudos
Message 2 of 3
(662 Views)

Hi

I'm sorry I did not see the i was from the while loop.

 

But why so difficult. Just switch on the lamp and read it 100 times then switch it off and read again 100 times. Why the while?

greetings from the Netherlands
0 Kudos
Message 3 of 3
(660 Views)