Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

the content of the example file ReadASCIIString.ino feels odd to me. #35

Copy link
Copy link
Open
@mj2068

Description

@mj2068
Issue body actions

file: examples/04.Communication/ReadASCIIString/ReadASCIIString.ino
`
/*
...
It parses them into ints, and uses those to fade an RGB LED.
Circuit: Common-Cathode RGB LED wired like so:

  • red anode: digital pin 3 through 220 ohm resistor

  • green anode: digital pin 5 through 220 ohm resistor

  • blue anode: digital pin 6 through 220 ohm resistor

  • cathode: GND
    ...

    if (Serial.read() == '\n') {
    // constrain the values to 0 - 255 and invert
    // if you're using a common-cathode LED, just use "constrain(color, 0, 255);"
    red = 255 - constrain(red, 0, 255);
    green = 255 - constrain(green, 0, 255);
    blue = 255 - constrain(blue, 0, 255);
    ...
    "
    `

the implementation of this example file feels odd to me.
i mean the circuit wiring instruction part in the starting comment describes using a Common-Cathode RGB LED, i think people would assume the actual code implementation will be using a Common-Cathode RGB LED as well, but no, the code is actually for a Common-Anode RGB LED, plus the prior comment line confirms the starting comment. don't you feel odd about this? i think we should be consistent comments and code. (at least for me, this took some time to fully figure out the logic of the flow and understand what was going on... idk, maybe it's just me being dumb... :p )

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.