https://github.com/brianpugh/micropython-single-pin-led-switch-demo
MicroPython demo using a single pin to read a switch and to control an LED.
https://github.com/brianpugh/micropython-single-pin-led-switch-demo
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (8.8%) to scientific vocabulary
Repository
MicroPython demo using a single pin to read a switch and to control an LED.
Basic Info
- Host: GitHub
- Owner: BrianPugh
- License: apache-2.0
- Language: Python
- Default Branch: main
- Size: 96.7 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Demo using a single pin to read a switch and to control an LED. This can be particularly useful for saving I/O and reducing the amount of wire/cabling required for panel-mounted elements. Requires a 10kΩ resistor for the switch, in addition to the LED's current limiting resistor.
Usage
This demo uses belay for package management and computer/hardware interactions. Install belay:
pip install belay
Then run main.py with your micropython board's port. For example:
python main.py /dev/ttyUSB0
The LED should blink once a second, and the current state of the switch will be printed to stdout:
Switch State: True
Switch State: False
How it works
This demo uses the micropython dependency debouncedpin. The pin is in output mode ~99% of the time to activate/deactivate the LED. Periodically (50 times a second), the pin is briefly set as an input and used to record the switch state. Switch debouncing is also automatically performed.
Owner
- Name: Brian Pugh
- Login: BrianPugh
- Kind: user
- Location: Washington D.C.
- Repositories: 123
- Profile: https://github.com/BrianPugh
Deep Learning Scientist and blockchain enthusiast
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0