Hi Guys,
I've stumbled on a small issue that is doing my head in.
Whilst using 8 bit resolution for the fading (ie 0 - 255) the code works and allows a minimum fade up / down time of 5 minutes, I now want to increase the resolution to 4095 steps.
Code:
blue_delay_in = fadesetHR[0] * 3600 + fadesetMN[0] * 60 / 255
white_delay_in = fadesetHR[1] * 3600 + fadesetMN[1] * 60 / 255
blue_delay_out = fadeoutHR[0] * 3600 + fadeoutMN[0] * 60 / 255
white_delay_out = fadeoutHR[1] * 3600 + fadeoutMN[1] * 60 / 255
If the above is changed by removing the 255 at the end of each line and replacing that with 4095 it means the minimum fade in/out time is now 68 minutes as anything less results in an FP decimal which isn't supported by PBP
The resulting value for blue_fade_in etc is then used in the case statements to perform the PWM
Code:
case DAWN
lcdout $FE,$80+15,"DAWN "
if ss//blue_delay_in = 0 then
if ss != old_ss_blue then
B_PWM=B_PWM+1
old_ss_blue=ss
endif
endif
if B_PWM = B_Mid then
Blue_Day_Cycle = MORN
endif
Is there anything I can do to the code as it stands to get the timing so that I can use the 4095 resolution, and still have fade in/out times of 5 minutes or more rather than 68 minutes.
Bookmarks