You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be able to turn it off, I used esp.set_digital_write and ended up changing the PWM pin to digital when the duty cycle is 0 or 100% like this:
classPWMOut2(PWMOut.PWMOut):
@propertydefduty_cycle(self):
returnsuper().duty_cycle()
@duty_cycle.setterdefduty_cycle(self, duty_cycle):
self._is_deinited()
ifnotisinstance(duty_cycle, (int, float)):
raiseTypeError("Invalid duty_cycle, should be int or float.")
duty_cycle/=65535.0ifnot0.0<=duty_cycle<=1.0:
raiseValueError("Invalid duty_cycle, should be between 0.0 and 1.0")
# If the value is 0 or 1, turn into a digital pin instead of PWMifduty_cycle==0.0:
self._esp.set_pin_mode(self._pwm_pin,1)
self._esp.set_digital_write(self._pwm_pin, False)
elifduty_cycle==1.0:
self._esp.set_pin_mode(self._pwm_pin,1)
self._esp.set_digital_write(self._pwm_pin, True)
else:
self._esp.set_analog_write(self._pwm_pin, duty_cycle)
RED_LED=PWMOut2(esp, LEDR)
GREEN_LED=PWMOut2(esp, LEDG)
BLUE_LED=PWMOut2(esp, LEDB)
status_light=adafruit_rgbled.RGBLED(RED_LED, GREEN_LED, BLUE_LED, invert_pwm=True)
status_light.color= (0,0,0)
This might be an issue with the Nina firmware or the board's design, but I wonder if it would be ok to have that kind of things in the base code, or if it would be better to make a community library for the Nano.
The text was updated successfully, but these errors were encountered:
@anecdata there is a way to transfer an issue to a different repo. I'm not sure what you mean to re-file it in the parent repository, if transfer would work we can do that though
It seems that the issue is really with the Arduino NINA firmware (parent of the forked Adafruit NINA firmware). Ideally we could push the Adafruit NINA PR up to Arduino? Or just file a new issue I suppose.
The following code on the Arduino Nano Connect 2040 results in a dim white light:
To be able to turn it off, I used
esp.set_digital_write
and ended up changing the PWM pin to digital when the duty cycle is 0 or 100% like this:This might be an issue with the Nina firmware or the board's design, but I wonder if it would be ok to have that kind of things in the base code, or if it would be better to make a community library for the Nano.
The text was updated successfully, but these errors were encountered: