Some short time ago inglewoodpete posted a basic program to fade an LED on/off to look like a pulsating beacon light, in response to a query of mine. It basically loops, using PWMDUTY and incrementing the duty cycle each time. It starts with "PWMOUT c.2,63,0" and then increments up to "PWMDUTY,c.2,254" before reversing direction to dim the LED, then starting again.
It works fine, but the numbers have me slightly puzzled: In the manual it says that the Period is a variable/constant from 0-255, and the Duty Cycle is a variable/constant from 0-1023, but the accompanying graphic appears to suggest that the Duty Cycle should be smaller than the Period, but that's obviously not the case when one reads the text.
So, taking "PWMDUTY,c2,245" as an example, does that mean that the LED will be powered for 245/1023 of whatever the Period is, and using Duty Cycle = 1023 will power it for 100% of whatever the Period is -- i.e. fully on?
It works fine, but the numbers have me slightly puzzled: In the manual it says that the Period is a variable/constant from 0-255, and the Duty Cycle is a variable/constant from 0-1023, but the accompanying graphic appears to suggest that the Duty Cycle should be smaller than the Period, but that's obviously not the case when one reads the text.
So, taking "PWMDUTY,c2,245" as an example, does that mean that the LED will be powered for 245/1023 of whatever the Period is, and using Duty Cycle = 1023 will power it for 100% of whatever the Period is -- i.e. fully on?