independantly dim two banks of LEDs
originally, thought i'd end standalone controller adjust photoperiod between 2 alternating sets of 3w leds, independently dim them , read , control lcd. i've come realize takes considerable talent , knowledge. heavy lift me alternating part sketched. absolute beginner here. anyway, here's have far.
int redled = 8;
int redfan = 9;
int blueled = 10;
int bluefan = 11;
unsigned int minutesinms(int m){
return m*60000; //converts milliseconds minutes
}
void setup() // run once, when sketch starts
{
pinmode(redled, output); // sets digital pins outputs
pinmode(redfan, output);
pinmode(blueled, output);
pinmode(bluefan, output);
}
void loop() {
digitalwrite(redled, high);
digitalwrite(redfan, high);
digitalwrite(blueled, low);
digitalwrite(bluefan, low);
delay(minutesinms(300));
digitalwrite(redled, low);
digitalwrite(redfan, low);
digitalwrite(blueled, high);
digitalwrite(bluefan, high);
delay(minutesinms(300));
}
// returns minutes in milliseconds
due limited coding ability, i've decided plug arduino computer change photoperiod. part's done.
would reasonably "easy" write code allow me plug arduino computer , independently change dimming value on each set of leds , forgo lcd, buttons/pot? (it's not soldering parts that's killing me, it's supporting code)
any appreciated.
if so, know might find sketch might close need parts , learn from, or maybe point me in right direction?
int redled = 8;
int redfan = 9;
int blueled = 10;
int bluefan = 11;
unsigned int minutesinms(int m){
return m*60000; //converts milliseconds minutes
}
void setup() // run once, when sketch starts
{
pinmode(redled, output); // sets digital pins outputs
pinmode(redfan, output);
pinmode(blueled, output);
pinmode(bluefan, output);
}
void loop() {
digitalwrite(redled, high);
digitalwrite(redfan, high);
digitalwrite(blueled, low);
digitalwrite(bluefan, low);
delay(minutesinms(300));
digitalwrite(redled, low);
digitalwrite(redfan, low);
digitalwrite(blueled, high);
digitalwrite(bluefan, high);
delay(minutesinms(300));
}
// returns minutes in milliseconds
due limited coding ability, i've decided plug arduino computer change photoperiod. part's done.
would reasonably "easy" write code allow me plug arduino computer , independently change dimming value on each set of leds , forgo lcd, buttons/pot? (it's not soldering parts that's killing me, it's supporting code)
any appreciated.
if so, know might find sketch might close need parts , learn from, or maybe point me in right direction?
run bit on timer variable toggled each time function called, i.e can turn them on/off or off/on
not sure mean dimming. perhaps use analogwrite instead??
pc control, not hard if offload stuff (above) timer.
lcd panel
well start getting panel , find code work, integrate other code
code: [select]
digitalwrite(redled, high);
digitalwrite(redfan, high);
digitalwrite(blueled, low);
digitalwrite(bluefan, low);
not sure mean dimming. perhaps use analogwrite instead??
pc control, not hard if offload stuff (above) timer.
lcd panel
well start getting panel , find code work, integrate other code
Arduino Forum > Using Arduino > Project Guidance > independantly dim two banks of LEDs
arduino
Comments
Post a Comment