
It obviously can't be over 100%, right? Only thing I can think of is that it might be due to Roberto modifying my PWM module to send an analog signal instead of PWM.
Any ideas?

Code: Select all
//--------------------------------------------------- Start of Global Variables ---------------------------------------------------
// This is just how we are going to reference the PWM expansion ports within the code.
// You can change the labels if you would like, just as long as they are changed all throughout the code too.
#define LEDPWM0 0
#define LEDPWM1 1
#define LEDPWM2 2
#define LEDPWM3 3
#define LEDPWM4 4
#define LEDPWM5 5
// Initial values to all 6 PWM channels at startup. They will always be 0.
byte PWMChannel[]={
0,0,0,0,0,0};
Code: Select all
void loop
//------------------------------------------------ Start PWM Expansion Code for Slope ----------------------------------------------
// Temporarily using Memory Locations from PWM Slope Actinic (for LEDPWM0 and LEDPWM1) and
// PWM Slope Daylight (for LEDPWM2 and LEDPWM3) for the start, end, durations.
// Will change the start%, end%, duration of each to new memory locations for each channel when Curt provides libraries update.
PWMChannel[LEDPWM0]=PWMSlope(
InternalMemory.StdLightsOnHour_read(),
InternalMemory.StdLightsOnMinute_read(),
InternalMemory.StdLightsOffHour_read(),
InternalMemory.StdLightsOffMinute_read(),
InternalMemory.read(852), // start %
InternalMemory.read(853), // end %
InternalMemory.read(854), // duration
PWMChannel[LEDPWM0]);
PWMChannel[LEDPWM1]=PWMChannel[LEDPWM0];
PWMChannel[LEDPWM2]=PWMSlope(
InternalMemory.MHOnHour_read(),
InternalMemory.MHOnMinute_read(),
InternalMemory.MHOffHour_read(),
InternalMemory.MHOffMinute_read(),
InternalMemory.read(849), // start %
InternalMemory.read(850), // end %
InternalMemory.read(851), // duration
PWMChannel[LEDPWM2]);
PWMChannel[LEDPWM3]=PWMChannel[LEDPWM2];
// The lines above are what calculates the slope.
// You can change the schedule by changing the parameter inside the parenthesis of the PWMSlope() function
// The are as follow:
// 1st parameter: hour to start slope
// 2nd parameter: minute to start slope
// 3rd parameter: hour to end slope
// 4th parameter: minute to end slope
// 5th parameter: % of the PWM signal to start slope
// 6th parameter: % of the PWM signal to end slope
// 7th parameter: duration of slope in minutes
// 8th parameter: always the same as the variable before the PWMSlope() call
//PWMChannel[LEDPWM1]=PWMSlope(15,0,21,30,15,45,90,PWMChannel[LEDPWM1]);
// In the example above, we are starting the slope at 3:00pm with 15% and going up to 45% within 90 minutes, which would be 4:30pm.
// Then it would stay at 45% from 4:30 to 90 minutes prior to 9:30pm, which would be 8:00pm.
// Then from 8:00pm, it would start sloping down from 45% all the way back to 15% within 90 minutes, which would be 9:30pm.
//CheckCloud(); (May be used at a later date with cloud/storm effects)
ReefAngel.PWM.Expansion(LEDPWM0,int(2.55*PWMChannel[LEDPWM0]));
ReefAngel.PWM.Expansion(LEDPWM1,int(2.55*PWMChannel[LEDPWM1]));
ReefAngel.PWM.Expansion(LEDPWM2,int(2.55*PWMChannel[LEDPWM2]));
ReefAngel.PWM.Expansion(LEDPWM3,int(2.55*PWMChannel[LEDPWM3]));
ReefAngel.ShowInterface();
//------------------------------------------------- End PWM Expansion Code for Slope ----------------------------------------------