Quote:
Originally Posted by sdtimer
I was change code for PWM, not use loop. and add code update_leds() to ISR(TIMER4_COMPB_vect).
Is this code OK?
I want to add ORP&WI-FI module, and make this controller in china, are you agree?
If you disagree, I must stop it!
|
I don't think you can add that routine into ISR. The ISRs currently take about 100-200us time to execute. The LED functions contain a lot of floating point operations and will take a lot of time inside the ISR. Besides, you cannot call analogWrite inside an ISR, you have to write directly to timer registers. I can see a time based ramp up/ ramp down can work in ISR, but not a sunrise/sunset based function with a lot of floating point calculations.
What LED are you using? If I can get a unit to test and use, I can write a code for it.
It is possible to add ORP, Wifi etc. ORP and Conductivity/Salinity (specific gravity) probes are currently supported when using the htm with Neptune Apex controller. Arduino Wifi shield will be easier to convert. Using wifi like RN-XV wifly with serial interface will take a lot more work to convert. Do you have any low cost wifi module you plan to use?
Please
email me regarding your plan with the controller.