Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bartoszadamczyk/pico-ir
IR library for Raspberry Pi Pico
https://github.com/bartoszadamczyk/pico-ir
Last synced: 25 days ago
JSON representation
IR library for Raspberry Pi Pico
- Host: GitHub
- URL: https://github.com/bartoszadamczyk/pico-ir
- Owner: bartoszadamczyk
- License: apache-2.0
- Created: 2022-01-16T02:03:20.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-20T16:05:30.000Z (9 months ago)
- Last Synced: 2024-08-05T00:06:51.042Z (4 months ago)
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 21
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micropython - pico-ir - IR library for Raspberry Pi Pico. (Libraries / Communications)
README
# Pico IR
[![Lint](https://github.com/bartoszadamczyk/pico-ir/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/bartoszadamczyk/pico-ir/actions/workflows/lint.yml)
[![License: MIT](https://img.shields.io/github/license/bartoszadamczyk/pico-ir)](https://github.com/bartoszadamczyk/pico-ir/blob/main/LICENSE)Complete IR library for Raspberry Pico
## Warning
Remember to check your modules' voltage, you might need logic level converter to convert between 3v3 and 5v!
## Example
```python
import utime
from machine import Pin
from pico_ir import read_code, send_code, validate_code, InvalidCodeExceptionpin_in = Pin(20, Pin.IN, Pin.PULL_UP)
pin_out = Pin(21, mode=Pin.OUT)while True:
out = read_code(pin_in)
# ignore random signals
if out:
try:
validate_code(out)
print(out)
utime.sleep(3)
send_code(pin_out, out)
except InvalidCodeException:
print("InvalidCodeException:" + out)
```