int ldr;
int ldr1;
int ldr2;
int ldr3;
int ldr4;
int bri;
void setup() {
// put your setup code here, to run once:
pinMode(A0, INPUT);
pinMode(6, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
ldr = analogRead(A0);
bri = map(ldr, 0, 1023, 0, 255);
analogWrite(6, bri);
}
I have to control intensity of 5 different spectrum led with ldr sensor. I don't know how to write a code for each spectrum to control brightness. Can any one help me?
I have no clue what you want to achieve...
Hi,
Did the code you posted in post #1 work for one LDR and output?
What is the output you are controlling?
Can you please post a schematic, showing your component names and pi labels?
What model Arduino are you using?
What parts of the spectrum are you looking at?
Thanks.. Tom..
Yes I know that, I have to desiign 150W led driver with 5 spectrums (White, Blue, Red, IR and UV). Now I have to control brightness of each spectrum individually. So for that purpose I have connected LED'S to TLC5940 IC and TLC5940 IC to the Aduino Nano as shown in the above schematic.
Hi,
I'm sorry but that doesn't really show all that much information, that is a diagram for a PCB design.
Can you post a proper schematic with connected components rather than net names?
Also you should be able to get an EXPORTED jpg image from your CAD program rather than a screen capture.
How will you get LDRs to detect ;
I think you had better check your sensor data and experiment with them before going to PCB or any final code.
Have have you built a prototype of at least one channel for proof of concept?
Thanks.. Tom..
Sure the forum can help. Help us to help you
You have to describe in more detail what setup you have
is this one single LED-driver which is mutually exclusive connected to a
White, Blue, Red, IR and UV LED?
Is this a setup of 5 drivers where all 5 drivers und LEDs can be lightet up at the same time and you use a single LDR to adjust the brightness of all five drivers?
please prpost a link to the datasheet of the TLC5940IC and describe the function of this IC
Are these LEDs the 150W LEDs or something else?
It is unclear if the TLC5940 is your ldr-sensor or something else
Do you use a single LED as the reference or all leds than sum up to 150 W?
Is the brightness measured by the "ldr-sensor" or by the TLC5940 ?
You should really take time to read here
how to get the best out of this forum
best regards Stefan
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.