Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrahaim/swift-raspberry-pi-adafruit-led
Swift implementation for accessing adafruit LEDs on a raspberry pi
https://github.com/jrahaim/swift-raspberry-pi-adafruit-led
Last synced: 6 days ago
JSON representation
Swift implementation for accessing adafruit LEDs on a raspberry pi
- Host: GitHub
- URL: https://github.com/jrahaim/swift-raspberry-pi-adafruit-led
- Owner: jrahaim
- Created: 2018-03-25T21:56:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-26T19:43:07.000Z (over 6 years ago)
- Last Synced: 2024-08-02T07:01:50.772Z (4 months ago)
- Language: Swift
- Size: 18.6 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-embedded-swift - swift-raspberry-pi-adafruit-led - Swift implementation for accessing adafruit LEDs on a raspberry pi (LEDs / Networking, IoT, Bus Protocols, …)
README
# Swift Raspberry Pi HT16K33 implementation
Swift implementation for accessing adafruit LEDs on a raspberry pi
Building on the work of https://github.com/uraimo/SwiftyGPIO and https://github.com/adafruit/Adafruit_Python_LED_Backpack/
To add swift support for HT16K33 driven LEDs (like these from Adafruit):
- Adafruit Matrix 8x8 i2c LED https://learn.adafruit.com/adafruit-led-backpack/
- 4 Character 14 segment alpha numeric disoplay https://www.adafruit.com/product/1911## requirements
- Raspberry PI
- Raspbery PI running Unbuntu 16.04 Match
- Adafruit HT16K33 i2c Interface for 8x8 matrix or Alphanumeric 14 segment display.
- Swift 3.1## installation
add the following dependency to your Package.swift
```.Package(url: "https://github.com/jrahaim/swift-raspberry-pi-adafruit-led.git", majorVersion: 1)```
## usage
### Matrix8x8
```swiftimport HT16K33
var matrix = Matrix8x8(port: 0x70, board: .RaspberryPi3)
matrix.setPixel(x: x, y: x, on: true, write: true)
```### AlphaNumeric14
```swiftimport HT16K33
var a14 = AlphaNumeric14(port: 0x70, board: .RaspberryPi3)
a14.brightness(7)
a14.show("RsPi")
```## Supports
- Blinking
- Brightness
- clearing## Other Devices connected to HT16K33
It should be pretty straight forward to get other LEDs working. These are the only 2 deivices I have on hand to test.
## Disclaimer
I have no relationship with Adafruit other than being a customer.