Git Product home page Git Product logo

rock64-r64.gpio's Introduction

Rock64-R64.GPIO

A Python GPIO library for the Rock64 single-board computer (RPi.GPIO clone).

Python Libraries and Scripts

R64.GPIO
A re-implementation of the RPi.GPIO library for the Rock64. Currently under development.

I found that on kernel version 4.4.124 the pin channels are offset by 1000, so I added a function ("offset") to check the kernel version and add the offset accordingly.

On the Pine64 forum thread (view "Resources" below) I read that this offset is present since kernel version 4.4.103 and as such the function is configured to add the offset starting with that minor release.

The offset can be easily edited in the "_GPIO.py" file to suit new offsets that may arrise with new kernel releases.

See the wiki for documentation on Functions and GPIO Modes.

R64-GPIO-test.py
A simple test script. Outputs a list of internal vars, sets the GPIO mode to "BOARD", sets up a GPIO output (blinks an LED if connected to pin 16), sets up a GPIO input (pulls-up and reports the state of pin 18), then cleans up all GPIO exports and exits.

Library Installation and Usage:

Importing R64.GPIO
Below is the reccomended method for importing this library into your project. For alternate methods, see the Installation and Usage page in the wiki.

  1. Download the entire "R64" folder from the repo.
  2. Place the "R64" folder in the same directory as the Python script you're working with.
  3. Within your script, substitute the traditional "import RPi.GPIO as GPIO" line for "import R64.GPIO as GPIO".

Once imported, syntax for implemented functions should be identical to RPi.GPIO.

Test Platform

All testing of this library is done on a Rock64 (4GB model) running Armbian_5.42_Rock64 (Ubuntu Xenial).

Compatability with other versions of Linux running on the Rock64 is not gauranteed.

Resources

List of resources and reference material used while building the scripts and libraries in this repository

rock64-r64.gpio's People

Contributors

leapo avatar matei-ciobotaru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.