Skip to content
Snippets Groups Projects
Select Git revision
  • dualcore
  • ch3/leds
  • wip-bootstrap default
  • ch3/time
  • master
5 results

esppwm.h

  • Damien George's avatar
    632d8efa
    esp8266: Add PWM support. · 632d8efa
    Damien George authored
    PWM implementation uses a timer and interrupts (FRC1), taken from
    Espressif's/NodeMCU's implementation and adapted for our use.
    
    8 channels are supported, on pins 0, 2, 4, 5, 12, 13, 14, 15.
    
    Usage:
    
        import machine
        pwm0 = machine.PWM(machine.Pin(0))
        pwm0.freq(1000)
        pwm0.duty(500)
    
    Frequency is shared (ie the same) for all channels.  Frequency is
    between 1 and 1000.  Duty is between 0 and 1023.
    632d8efa
    History
    esp8266: Add PWM support.
    Damien George authored
    PWM implementation uses a timer and interrupts (FRC1), taken from
    Espressif's/NodeMCU's implementation and adapted for our use.
    
    8 channels are supported, on pins 0, 2, 4, 5, 12, 13, 14, 15.
    
    Usage:
    
        import machine
        pwm0 = machine.PWM(machine.Pin(0))
        pwm0.freq(1000)
        pwm0.duty(500)
    
    Frequency is shared (ie the same) for all channels.  Frequency is
    between 1 and 1000.  Duty is between 0 and 1023.