Skip to content

Max value for analogWrite(pin, value) ? #295

Closed

Description

@redflag2k

First of all, My environment is Arduino 1.6.4 with ESP8266 xxx.json (Latest release), ESP-12 version
and I am trying to test analogWrite for PWM.

I found my led strip is so dark at following code.

analogWrite(GPIO12, 255);

So, I changed the value 255 to 999. then the led strip became more brighter.

My question is that...

What is the maximum value of PWM? (In arduino uno, 255 is maximun value, because arduino is 8bit MCU)

My guess is that... In ESP8266, the maximum value of analogWrite is 0xFFFF (=65,535), because ESP8266 has 32bit cpu core.

Is my guessing right?

Activity

  1. igrr commented on May 21, 2015

    @igrr
    Member
  2. redflag2k commented on May 21, 2015

    @redflag2k
    Author

    Thank you for your clear reply.

  3. added a commit that references this issue on May 21, 2015
  4. added a commit that references this issue on Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions