EDIT: not bugged after all, my mistake
Posted: Mon Mar 30, 2015 7:04 am
This weekend, I was trying to 'fade' an LED from fully off to fully on by slowly increasing the duty cycle. After about the sixth call to pwm.setduty(), the module reboots.
The results were the same across different firmwares (build 20150213 and 20130318) and module types (ESP-03 and ESP-12). Changing the pin used had no effect, nor did changing the step size -- no matter what step size used, I could only change it about six times before the module rebooted.
I think this code will demonstrate the problem. I am replicating it from memory since I'm at work and don't have my ESP modules with me.
I tried doing a pwm.stop() and pwm.start() before and after the setduty calls, made no difference. I tried doing a full pwm.setup() call instead of pwm.setduty(), made no difference.
The results were the same across different firmwares (build 20150213 and 20130318) and module types (ESP-03 and ESP-12). Changing the pin used had no effect, nor did changing the step size -- no matter what step size used, I could only change it about six times before the module rebooted.
I think this code will demonstrate the problem. I am replicating it from memory since I'm at work and don't have my ESP modules with me.
Code: Select all
local pin=8
pwm.setup(pin, 1000, 0)
pwm.start(pin)
for i=0,1000,100 do
pwm.setduty(pin,i)
tmr.delay(500000)
end
I tried doing a pwm.stop() and pwm.start() before and after the setduty calls, made no difference. I tried doing a full pwm.setup() call instead of pwm.setduty(), made no difference.