The 40 mm square NEO Air from NanoPi manufactured by FriendlyARM has similar capabilities to the Raspberry Pi zero but powered by an Allwinner H3 32-bit Cortex A7 quad-core processor running up to 1.2 GHz with 512 MB RAM and a micro SD slot. (That's about 12% smaller and much faster than Raspberry Pi Zero)
Its pins are compatible with the NanoPi NEO (v1.2) and its 24-pin header is compatible with Raspberry Pi's GPIO pin headers. The processor includes a Mali400 MP2 GPU but the board lacks an HDMI output connector, so the board can only be used for headless applications.
Hardware Specifications- CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz
- RAM: 512MB DDR3 RAM
- Storage: 8GB eMMC
- WiFi: 802.11b/g/n and Bluetooth 4.0 LE (via Ampak AP6212 module) with IPEX antenna connector
- DVP Camera: 0.5mm pitch 24 pin FPC seat
- MicroUSB: OTG and power input
- MicroSD Slot x 1
- Debug Serial Port: 4Pin, 2.54mm pitch pin header
- GPIO1: 2.54mm spacing 24pin, It includes UART, SPI, I2C, GPIO
- GPIO2: 2.54mm spacing 12pin, It includes USBx2, IR, SPDIF, I2S
- PCB Size: 40 x 40mm (Raspberry Pi Zero: 65mm × 30mm)
- PCB layer: 6
- Power Supply: DC 5V/2A
- OS/Software: u-boot, UbuntuCore, armbian, DietPi
- Weight: 7.5g (WITHOUT Pin-headers); 9.7g (WITH Pin-headers)
For more information about installing OS on NEO Air and GPIO description, please read the wiki page.
LED Blinking with NEO AirIn this section, we will perform a simple electronic projects. Unfortunately, there wasn't a lot of information to get access to the GPIO pins. For this example, I used the matrix library. The matrix library has been developed by FriendlyARM for C language. Also, another similar library for Python language is being developed.
Wiring- LED VCC <-> Pin 2 (VDD_5V)
- LED GND <-> Pin 7 (GPIOG11)
Boot your NEO Air and copy the matrix code:
$ apt-get update && apt-get install git
$ git clone https://github.com/friendlyarm/matrix.git
If your cloning is done successfully a "matrix
" directory will be generated. Compile and install Matrix:
$ cd matrix
$ make && make install
$ cd ..
Now, Create new file and copy following code into file. My file name is led.c
:
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "libfahw.h"
#define STATUS_CHANGE_TIMES 20
int main(int argc, char **argv)
{
int i;
int intValue = 0;
int pin = GPIO_PIN(7);
if (boardInit() < 0)
{
printf("Fail to init board\n");
return -1;
}
if (exportGPIOPin(pin) != 0)
{
printf("exportGPIOPin(%d) failed\n", pin);
}
if(setGPIODirection(pin, GPIO_OUT) == -1)
{
printf("setGPIODirection(%d) failed\r\n",pin);
}
for(i = 0; i < STATUS_CHANGE_TIMES; i++)
{
intValue ^= 1; //0 xor 1 = 1, 1 xor 1 = 0
if(setGPIOValue(pin, intValue) > 0)
{
printf("%d - GPIO_PIN(%d) value is %d\r\n",i+1, pin, intValue);
}
else
{
printf("setGPIOValue(%d) failed\r\n", pin);
}
usleep(500000);
}
unexportGPIOPin(pin);
return 0;
}
Compile led.c
file:
$ gcc -o led -L /matrix/lib/ -I /matrix/lib/includes/ led.c -lfahw -lm -Wall
Finally, run:
$ ./led
After running the program, the LED starts blinking.
Comments