Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Sephiroth87/scroll-phat-swift
Swift library to control the Pimoroni Scroll pHAT for Raspberry Pi
https://github.com/Sephiroth87/scroll-phat-swift
Last synced: 8 days ago
JSON representation
Swift library to control the Pimoroni Scroll pHAT for Raspberry Pi
- Host: GitHub
- URL: https://github.com/Sephiroth87/scroll-phat-swift
- Owner: Sephiroth87
- License: gpl-2.0
- Created: 2016-01-14T00:15:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-09T19:13:30.000Z (about 8 years ago)
- Last Synced: 2024-08-01T19:31:28.379Z (3 months ago)
- Language: Swift
- Size: 1.49 MB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swift-cn - Scroll-phat-swift - Control the Pimoroni Scroll pHAT. (Libs / Embedded Systems)
README
scroll-phat-swift is a Linux library to control [Pimoroni Scroll pHAT](https://shop.pimoroni.com/collections/raspberry-pi-zero/products/scroll-phat) for Raspberry Pi.
##Installation
Package Manager is not functional on Raspberry Pi yet, so you'll have to do it manually for now.
After cloning, compile your program adding the 2 system dependencies, the SMBus file and the scroll-phat one, like:
```
swiftc -o MyProgram -I ./SMBus/Packages/Ci2c -I ./SMBus/Packages/CioctlHelper ./SMBus/Sources/SMBus.swift ./Sources/ScrollpHAT.swift main.swift
```
You can look in the Examples folder for see how to build your program.##Usage
No need to import anything since the library is built together with your other sources.
Create a ScrollpHAT object:
```
let pHAT = try ScrollpHAT()
```
to turn on/off an led use :
```
pHAT.setPixel(x: 0, y: 0, value: true)
try pHAT.update()
```
write a string:
```
try pHAT.writeString("SWIFT")
```
scrolling:
```
try pHAT.scroll()
try pHAT.scrollTo(0)
```
##TODO
- [x] Add missing functions (text, scrolling)
- [ ] Add documentation
- [ ] Support Package Manager