-
-
Notifications
You must be signed in to change notification settings - Fork 39.4k
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
Update led_update_kb example #7451
Conversation
Related question: does this or a similar method work if the board uses Input/Output to toggle the LED instead of High/Low? And if not, can we make it do that? |
I kept these as discrete if statements because I figured it would be more understandable for newbs, but if you're going to change them to @noroadsleft I think (haven't tested...I should buy some breadboards tbh) that high/low will work for all cases, as we just need current flow. If both sides of the LED are at VCC or GND, it won't light up. When it's pointing from VCC to GND, it will light up. Whether the pin is input or output probably has no effect electrically, it's simply the fact that putting the pin into Hi-Z state basically disconnects one end of the circuit. |
I've updated the comment in the code example to reflect this information. Thanks! |
* for initial commit * for initial commit * for initial commit * Update led_update_kb example (#7451) * Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2 * Remove CR when computing BOOTLOADER_SIZE. (#7453) * Set up language fallback for docs, and update translation guidelines (#7403) * Set up language fallback for docs, and update translation guidelines * Title Case * Add ID example * Link to emoji flag cheatsheet * Move docs preview section to contributing.md * Point to docs preview in the readme * [Keyboard] Added Cans12er keyboard (#7455) * added cans12er keyboard * updated readme Updated the readme to conform with the provided template from the qmk_firmware githubpage * Update keyboards/cans12er/README.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Changed configuration Changed the configuration based on the Change Request from PR #7455 made by github user noroadsleft * [Keyboard] Update ATmega32A readme files to match template (#7462) * Update atmega32a readme files to match template * Update atmega32a readme files to match template - fixes * Apply suggestions from code review * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Co-Authored-By: shela <shelaf@users.noreply.github.com>
* Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2
* for initial commit * for initial commit * for initial commit * Update led_update_kb example (qmk#7451) * Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2 * Remove CR when computing BOOTLOADER_SIZE. (qmk#7453) * Set up language fallback for docs, and update translation guidelines (qmk#7403) * Set up language fallback for docs, and update translation guidelines * Title Case * Add ID example * Link to emoji flag cheatsheet * Move docs preview section to contributing.md * Point to docs preview in the readme * [Keyboard] Added Cans12er keyboard (qmk#7455) * added cans12er keyboard * updated readme Updated the readme to conform with the provided template from the qmk_firmware githubpage * Update keyboards/cans12er/README.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Changed configuration Changed the configuration based on the Change Request from PR qmk#7455 made by github user noroadsleft * [Keyboard] Update ATmega32A readme files to match template (qmk#7462) * Update atmega32a readme files to match template * Update atmega32a readme files to match template - fixes * Apply suggestions from code review * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Co-Authored-By: shela <shelaf@users.noreply.github.com>
* Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2
* for initial commit * for initial commit * for initial commit * Update led_update_kb example (qmk#7451) * Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2 * Remove CR when computing BOOTLOADER_SIZE. (qmk#7453) * Set up language fallback for docs, and update translation guidelines (qmk#7403) * Set up language fallback for docs, and update translation guidelines * Title Case * Add ID example * Link to emoji flag cheatsheet * Move docs preview section to contributing.md * Point to docs preview in the readme * [Keyboard] Added Cans12er keyboard (qmk#7455) * added cans12er keyboard * updated readme Updated the readme to conform with the provided template from the qmk_firmware githubpage * Update keyboards/cans12er/README.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Changed configuration Changed the configuration based on the Change Request from PR qmk#7455 made by github user noroadsleft * [Keyboard] Update ATmega32A readme files to match template (qmk#7462) * Update atmega32a readme files to match template * Update atmega32a readme files to match template - fixes * Apply suggestions from code review * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Co-Authored-By: shela <shelaf@users.noreply.github.com>
* Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2
* for initial commit * for initial commit * for initial commit * Update led_update_kb example (qmk#7451) * Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2 * Remove CR when computing BOOTLOADER_SIZE. (qmk#7453) * Set up language fallback for docs, and update translation guidelines (qmk#7403) * Set up language fallback for docs, and update translation guidelines * Title Case * Add ID example * Link to emoji flag cheatsheet * Move docs preview section to contributing.md * Point to docs preview in the readme * [Keyboard] Added Cans12er keyboard (qmk#7455) * added cans12er keyboard * updated readme Updated the readme to conform with the provided template from the qmk_firmware githubpage * Update keyboards/cans12er/README.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Changed configuration Changed the configuration based on the Change Request from PR qmk#7455 made by github user noroadsleft * [Keyboard] Update ATmega32A readme files to match template (qmk#7462) * Update atmega32a readme files to match template * Update atmega32a readme files to match template - fixes * Apply suggestions from code review * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Co-Authored-By: shela <shelaf@users.noreply.github.com>
Thanks for this example. I had to set the pin as an output using SetPinOutput in my init to get it to work though. |
* Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2
* for initial commit * for initial commit * for initial commit * Update led_update_kb example (qmk#7451) * Update led_update_kb example * Update comment to explain pin behavior * wordsmith * wordsmithing 2 * Remove CR when computing BOOTLOADER_SIZE. (qmk#7453) * Set up language fallback for docs, and update translation guidelines (qmk#7403) * Set up language fallback for docs, and update translation guidelines * Title Case * Add ID example * Link to emoji flag cheatsheet * Move docs preview section to contributing.md * Point to docs preview in the readme * [Keyboard] Added Cans12er keyboard (qmk#7455) * added cans12er keyboard * updated readme Updated the readme to conform with the provided template from the qmk_firmware githubpage * Update keyboards/cans12er/README.md Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com> * Changed configuration Changed the configuration based on the Change Request from PR qmk#7455 made by github user noroadsleft * [Keyboard] Update ATmega32A readme files to match template (qmk#7462) * Update atmega32a readme files to match template * Update atmega32a readme files to match template - fixes * Apply suggestions from code review * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments * update files based on comments Co-Authored-By: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Co-Authored-By: shela <shelaf@users.noreply.github.com>
Provide a more succinct and less verbose example for a custom LED function.
Description
Types of Changes
Issues Fixed or Closed by This PR
Checklist