Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inappropriate part of the code in the explanation of the code itself #1

Open
olegbarabanov opened this issue Nov 19, 2023 · 0 comments

Comments

@olegbarabanov
Copy link

In C_Tutorial.pdf on page 63 of Chapter 5 (RGBLED) there is an inappropriate part of the code to explain the code itself.

That code is in there now:

void setColor(long rgb) {
 ledcWrite(chns[0], 255 - (rgb >> 16) & 0xFF);
 ledcWrite(chns[1], 255 - (rgb >> 8) & 0xFF);
 ledcWrite(chns[2], 255 - (rgb >> 0) & 0xFF);
}

This example is probably copied from the ESP32 C tutorial. Instead, there should be this code:

void setColor(long rgb) {
 analogWrite(ledPins[0], 255 - (rgb >> 16) & 0xFF);
 analogWrite(ledPins[1], 255 - (rgb >> 8) & 0xFF);
 analogWrite(ledPins[2], 255 - (rgb >> 0) & 0xFF);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant