For instance, the wizard uses static "magic numbers" when dimming parabolas etc are created and puts them in the "loop" section, which means (unless I'm mistaken) that you can't really override these values. I have started going through and writing a small library that makes the entire dimming module easier to both remote control, and to understand in the loop() section, so that my init() has items like this:
Code: Select all
SetActinicLEDMax(90);
SetActinicLEDMin(10);
SetRedLEDMax(90);
SetRedLEDMin(10);
SetWhiteLEDMax(90);
SetWhiteLEDMin(10);
SetActinicLEDStartHour(09);
SetActinicLEDStartMinute(30);
SetRedLEDStartHour(10);
SetRedLEDStartMinute(00);
SetWhiteLEDStartHour(10);
SetWhiteLEDStartMinute(00);
SetActinicLEDEndHour(21);
SetActinicLEDEndMinute(00);
SetRedLEDEndHour(20);
SetRedLEDEndMinute(00);
SetWhiteLEDEndHour(20);
SetWhiteLEDEndMinute(00);
SetWhiteLEDDimmingParabolaRate(80);
SetRedLEDDimmingParabolaRate(80);
SetActinicLEDDimmingParabolaRate(60);
//Pretty sure the RA inits with garbage in these, so we'll set the initial state to false (no override, operate in parabola mode) just to be certain
OverrideNormalActinicLEDSettings(false);
OverrideNormalRedLEDSettings(false);
OverrideNormalWhiteLEDSettings(false);
And my loop() looks like this:
Code: Select all
ReefAngel.PWM.SetChannel( 0, PWMSlope(GetActinicLEDStartHour(),GetActinicLEDStartMinute(),GetActinicLEDEndHour(),GetActinicLEDEndMinute(),GetActinicLEDMin(),GetActinicLEDMax(),GetActinicLEDDimmingParabolaRate(),GetActinicLEDMin()) );
ReefAngel.PWM.SetChannel( 3, PWMSlope(GetActinicLEDStartHour(),GetActinicLEDStartMinute(),GetActinicLEDEndHour(),GetActinicLEDEndMinute(),GetActinicLEDMin(),GetActinicLEDMax(),GetActinicLEDDimmingParabolaRate(),GetActinicLEDMin()) );
Does this already exist and I'm reinventing the wheel? Or might it be a nice way to transition into demonstrating even more of the RA's awesome potential out of the box without having to have the user set memory values manually?