Giter Site home page Giter Site logo

samuelrock / wiringop-zero Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vladikoms/wiringop-zero

0.0 1.0 0.0 312 KB

WiringPi / WiringOP libary for the Orange Pi Zero with 26 pin GPIO header

License: GNU Lesser General Public License v3.0

Makefile 3.12% Shell 1.68% C 92.09% Roff 2.14% TeX 0.97%

wiringop-zero's Introduction

WiringOP-Zero

WiringPi / WiringOP libary for the Orange Pi Zero with 26 pin GPIO header

This is a modified WiringPi for specially OrangePi Zero.

GPIO and SPI working, i2c not testet yet!

Download

git clone https://github.com/vladikoms/WiringOP-Zero.git

Installation

cd WiringOP-Zero
chmod +x ./build
sudo ./build

Test

christian@orangepizero:~/WiringOP-Zero$ gpio readall
 +-----+-----+----------+------+--Orange Pi Zero--+---+------+---------+-----+--+
 | H2+ | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | H2+ |
 +-----+-----+----------+------+---+----++----+---+------+----------+-----+-----+
 |     |     |     3.3v |      |   |  1 || 2  |   |      | 5v       |     |     |
 |  12 |   8 |    SDA.0 | ALT5 | 0 |  3 || 4  |   |      | 5V       |     |     |
 |  11 |   9 |    SCL.0 | ALT5 | 0 |  5 || 6  |   |      | 0v       |     |     |
 |   6 |   7 |   GPIO.7 | ALT3 | 0 |  7 || 8  | 0 | ALT5 | TxD3     | 15  | 198 |
 |     |     |       0v |      |   |  9 || 10 | 0 | ALT5 | RxD3     | 16  | 199 |
 |   1 |   0 |     RxD2 | ALT5 | 0 | 11 || 12 | 0 | ALT3 | GPIO.1   | 1   | 7   |
 |   0 |   2 |     TxD2 | ALT5 | 0 | 13 || 14 |   |      | 0v       |     |     |
 |   3 |   3 |     CTS2 | ALT3 | 0 | 15 || 16 | 0 | ALT4 | GPIO.4   | 4   | 19  |
 |     |     |     3.3v |      |   | 17 || 18 | 0 | ALT4 | GPIO.5   | 5   | 18  |
 |  15 |  12 |     MOSI | ALT5 | 0 | 19 || 20 |   |      | 0v       |     |     |
 |  16 |  13 |     MISO | ALT5 | 0 | 21 || 22 | 0 | ALT3 | RTS2     | 6   | 2   |
 |  14 |  14 |     SCLK | ALT5 | 0 | 23 || 24 | 0 | ALT5 | CE0      | 10  | 13  |
 |     |     |       0v |      |   | 25 || 26 | 0 | ALT3 | GPIO.11  | 11  | 10  |
 +-----+-----+----------+------+---+---LEDs---+---+------+----------+-----+-----+
 |  17 |  30 | STAT-LED |  OUT | 0 | 27 || 28 |   |      | PWR-LED  |     |     |
 +-----+-----+----------+------+---+-----+----+---+------+----------+-----+-----+
 | H2+ | wPi |   Name   | Mode | V | Physical | V | Mode | Name     | wPi | H2+ |
 +-----+-----+----------+------+--Orange Pi Zero--+---+------+---------+-----+--+

To control red LED on the board run for example this:

gpio write 30 1 

and to turn off this

gpio write 30 0 

Small test program: Blink

Create a file called blink.c with the content:

#include <stdio.h>
#include <wiringPi.h>
int main (void)
{
wiringPiSetup ();
pinMode (30, OUTPUT);
printf ("Test program is running.\n");
printf ("Status LED is flashing.\n");
printf ("Press CTRL+C to stop programm.\n");
for (;;)
{
digitalWrite (30, HIGH);
delay (500);
digitalWrite (30, LOW);
delay (500);
}
return 0;
}

Then to compile and run, you would enter below in the command line:

gcc -Wall -o blink blink.c -lwiringPi
sudo ./blink

Thanks to zhaolei & xpertsavenue, who created the libary for this one!

wiringop-zero's People

Watchers

James Cloos 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.