Swiftpack.co - creekpld/nanohat-oled as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by creekpld.
creekpld/nanohat-oled 1.0.0
A swift library is written for using the NanoHat OLED
⭐️ 1
🕓 3 years ago
.package(url: "https://github.com/creekpld/nanohat-oled.git", from: "1.0.0")

This is not the Repo you are looking for! :alien:

New development is taking place in gitlab.com/pdylong/nanohat-oled :ok_hand:.

NanoHat OLED - Swift4 Version

This is a swift library written for using the NanoHat OLED: http://wiki.friendlyarm.com/wiki/index.php/NanoHat_OLED

supported boards:

  • NanoPi NEO
  • NanoPi NEO Air
  • NanoPi NEO2
  • NanoPi NEO Plus2

Basic Font

Hello OLED

Installation

Install it with the Swift Package Manager.

// swift-tools-version:4.0

import PackageDescription

let package = Package(
    name: "YourApp",
    products: [
        .executable(name: "YourApp", targets: ["YourApp"]),
    ],
    dependencies: [
        .Package(url: "https://github.com/creekpld/nanohat-oled.git", from: "1.0.0")
    ],
    targets: [
        .target(
            name: "YourApp",
            dependencies: ["NanoHatOLED"],
            path: "Sources"),
    ]
)

Usage

import NanoHatOLED

let oled = OLED() // default bus = 0, address = 0x3c

// initialize display
oled.setup()

// clear display
let arr = [UInt8](https://raw.github.com/creekpld/nanohat-oled/master/repeating: 0x00, count: 1024)
oled.sendArrayData(arr)

// set Cursor/Text Position
oled.setTextXY(0,4)

// print Hello, World!
let word = "Hello, World!"
for char in word {
    print("putChar=\(char)")
    oled.putChar(char.description)
}

Result: Hello OLED

Other Implementations

License

NanoHatOLED is available as open source under the terms of the MIT License.

GitHub

link
Stars: 1
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

v1.0.0
5 years ago

:tada: Initial Release

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics