LeMaker Guitar:GPIOlibrary

From BananaPro/Pi
Jump to: navigation, search

LeMaker Guitar.GPIO


LeMaker Guitar base board Rev.B.png

LeMaker Guitar Provides many functions like a PC,also provides J4 development interface.J4 is located at the bottom of the Guitar Baseboard,which is composed with 40 pins of 2.54mm double line,which is convenient for the user's use and expansion.

About the applications of 40 stitches,Readers can refer to LeMaker Guitar:S500 PIO Definition
Not only there is GPIO interface,but also include other interfaces such as I2C,UART and SPI in the 40 stitches.By these interfaces,Users will be able to cooperate with the corresponding software to complete a variety of electronic project or connected directly to a variety of equipment.
Before introducing how to install the GPIO libraries, first to learn about all the details of the interface:
1.GPIO(General Purpose Input/Output))obtain the corresponding equipment information through reading the output interface of up level and low level .So it is extremely convenient that using it as a control ,monitor and some simple equipment.
2.I2C(Inter-Intergrated Circuit)is a two wire serial communication bus which is launched by PHILIPS company.In Brief, It is a path to transmit information by conencting the devices of bus.Besides, I2C bus also have many advantages such as connection is simple,less signal line and mounting multiple slave devices,So the I2C interface has been widely used with all kinds of sensor chip.In the data acquisition application,The host mount multiple sensors on the bus through the I2C interface.So that obtain the value of multiple sensors,to analyze and statistics the collected data.
3.UART(Universal Asynchronous Receiver/Transmitte)is a simple comunication standard,often used to  realize full-duplex transmit and receive information between the host and auxiliary equipment.

General Purpose Input Output (General Input/Output) as the GPIO, or bus expander, use I2C, SMBus or industrial standard SPI interface simplifies the I/O port extension.When the micro controller or chipset do not have enough I/O ports, or when the system needs to use the remote serial communication or control, GPIO products can provide additional control and monitoring functions.

The modified LeMaker Guitar.GPIO library for LeMaker Guitar can be download from LeMaker github.


git clone https://github.com/LeMaker/RPi.GPIO_BP


You need have the python-dev package:

sudo apt-get update
sudo apt-get install python-dev

Compile and install:

python setup.py install                 
sudo python setup.py install

Attention: you need install twice setup.py like above, first not using sudo. After that, you can use the RPi.GPIO python script.



Wiring Pi is a GPIO library written by Drogon. It is originally for the Raspberry Pi, but LeMaker has modified and adapted it to make it work on the Banana Pro/Pi, we call it WiringBP. More example details can be found at http://wiringpi.com/. All these examples can be used directly on the Banana Pro/Pi.

How to use WiringPi on the LeMaker Guitar

Download the WiringBP on your Banana Pro/Pi.

git clone https://github.com/LeMaker/WiringBP -b bananapro

After download, you need direct into the WiringBP directory and run:

cd S500_WiringBP/
sudo chmod +x ./build

And then install the WiringBP:

sudo ./build

Check the Pin definitions in WiringPi

Please use the gpio command in the command line to see the pin definitions:

gpio readall

You will then see this information:

File:S500 Wiringpi pins.jpg