Skip to content

Swift library to control the Pimoroni Scroll pHAT for Raspberry Pi

License

Notifications You must be signed in to change notification settings

Sephiroth87/scroll-phat-swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#scroll-phat-swift Join the chat at https://gitter.im/Sephiroth87/scroll-phat-swift

scroll-phat-swift is a Linux library to control Pimoroni Scroll pHAT for Raspberry Pi.

Snake

##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

  • Add missing functions (text, scrolling)
  • Add documentation
  • Support Package Manager

About

Swift library to control the Pimoroni Scroll pHAT for Raspberry Pi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages