The module is designed specifically for learning control the GPIO of Banana Pi. There are 6 LED, 1 button and 1 Beep on the module; All of them can use the GPIO of Banana Pi to control. The beginner can learn the INPUT mode of GPIO through the key and learn the OUTPUT mode through the LED or Beep
6 multicolor LED
1 single button on board
1 Beep on board
BananaPi 2X13 port,also can use on raspberry pi.
Working voltage: 3.3V
LED max current allow 8mA
Beep max current allow 12mA
Hardware beginner learning
Education
Insert the BerryClip in the Banana Pi, Pay attention don’t make the direction reversed! The correct direction of insert module is above the Banana Pi’s PCB.
Setup the GPIO OUTPUT, Output LED High level, the LED will be lighten;
Setup the GPIO INPUT, press the button;
Test finish
#include <wiringPi.h>
int LED1[]={7,0,3,12,13,14};
int i;
int initIO()
{
pinMode(7,OUTPUT);
pinMode(0,OUTPUT);
pinMode(3,OUTPUT);
pinMode(12,OUTPUT);
pinMode(13,OUTPUT);
pinMode(14,OUTPUT);
}
int LED()
{
for(i=0;i<=6;i++)
{
digitalWrite(LED1[i],1);
delay(500);
digitalWrite(LED1[i],0);
delay(500);
}
}
int main()
{
int val;
wiringPiSetup();
initIO();
pinMode(10,INPUT);
digitalWrite(11,1);
while(1)
{
val=digitalRead(10);
if(val==0)
{
LED();
digitalWrite(11,1);
i=0;
}
}
}
OS: BPI-M3 Ubuntu15.10 (Kernel3.4)
Version: 1.0 HDMI
Step 1: Download WiringPI
$ git clone https://github.com/BPI-SINOVOIP/BPI-WiringPi.git -b BPI_M3
$ cd BPI-WiringPi
$ chmod +x ./build
$ sudo ./build
Step 2 : Copy smaple code to BerryClip.c file
$ sudo vi BerryClip.c
Step 3 : Compile BerryClip.c
$ gcc -o BerryClip BerryClip.c -l wiringPi
Step 4 : Run BerryClip
$ sudo ./BerryClip
Step 5: Press the button to see if it works
Video demo on youtube: https://www.youtube.com/watch?v=kIPbm86sqnw
Banana Pi BerryClip 6LED use on BPI-M2 demo : https://www.youtube.com/watch?v=E_LQXyNECNQ