Generate PWM Duty Table
Produce a lookup table that maps a linear brightness input to PWM duty cycles corrected for the eye's logarithmic response, so a fade looks smooth.
Constraints
- Table has 256 entries.
- Output duty values are integers from 0 to the given resolution.
- Use a gamma of 2.2.
- Entry 0 must be 0 and entry 255 must be the maximum duty.
- The table must be non-decreasing.
- No numpy.
1def gamma_table(max_duty=255, gamma=2.2):2 # TODO3 return []