Difference between revisions of "NanoHat OLED"
(→硬件连接) |
(→Hardware Setup) |
||
Line 50: | Line 50: | ||
The NanoHat OLED module has the same form factor as FriendlyElec's NanoPi NEO. It can be stacked on a NanoPi NEO/NEO2/Air. | The NanoHat OLED module has the same form factor as FriendlyElec's NanoPi NEO. It can be stacked on a NanoPi NEO/NEO2/Air. | ||
Here is a hardware setup:<br> | Here is a hardware setup:<br> | ||
− | [[File:NanoHat OLED_nanopi_NEO.jpg|frameless|600px|NanoHat OLED_nanopi_NEO]] | + | [[File:NanoHat OLED_nanopi_NEO.jpg|frameless|600px|NanoHat OLED_nanopi_NEO]]<br> |
Applicable Boards<br /> | Applicable Boards<br /> | ||
NanoPi NEO<br /> | NanoPi NEO<br /> |
Revision as of 02:17, 27 April 2017
1 Introduction
- NanoHat OLED is a small and cute monochrome OLED module with low power consumption. It is 0.96". Its resolution is 128 x 64. It communicates with a master device with I2C.
- The NanoHat OLED module has the same form factor as FriendlyElec's NanoPi NEO. It can be stacked on a NanoPi NEO.
- It has three onboard programmable user buttons, a 2.0mm pitch 4-Pin I2C connector.
2 Hardware Spec
- Display Area:0.96"
- Resolution: 128 x 64
- High Contrast, Low Power Consumption
- 3 x Onboard Button
- PCB Dimension(mm): 40 x 40
- GPIO Pin Description
Pin# Name Linux gpio Pin# Name Linux gpio 1 SYS_3.3V 2 VDD_5V 3 I2C0_SDA 4 VDD_5V 5 I2C0_SCL 6 GND 7 NC 8 NC 9 GND 10 NC 11 K1 0 12 NC 13 K2 2 14 GND 15 K3 3 16 NC 17 SYS_3.3V 18 NC 19 NC 20 GND 21 NC 22 NC 23 NC 24 NC
Only GND and 5V on the 12-Pin land are connected and the rest pins are open. For more details on the 12-Pin connector refer to NanoPi NEO/Air/NEO2's wiki site.
3 Hardware Setup
Currently only the NanoPi NEO, NEO2 and NanoPi NEO Air work with this module.
The NanoHat OLED module has the same form factor as FriendlyElec's NanoPi NEO. It can be stacked on a NanoPi NEO/NEO2/Air.
Here is a hardware setup:
Applicable Boards
NanoPi NEO
NanoPi NEO Air
NanoPi NEO2
4 软件安装
NanoHat OLED的演示程序包含在 NanoHatOLED 软件仓库里,在 Ubuntu core系统下,执行以下命令进行安装:
git clone https://github.com/friendlyarm/NanoHatOLED.git cd NanoHatOLED sudo -H ./install.sh
安装脚本会在线下载并安装一系列的软件包,安装时间视网络环境而定,国内用户为了获得更快的安装速度,可以在安装之前先将软件包的源设置为国内源,方法如下:
首先,编辑文件 /etc/apt/sources.list,将里面的内容清空并更改为:
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main multiverse restricted universe deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main multiverse restricted universe deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-proposed main multiverse restricted universe deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main multiverse restricted universe deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main multiverse restricted universe
然后,编辑(或新建) 文件 $HOME/.pip/pip.conf,将python的pip源设置为国内源,pip.conf内容如下:
[global] trusted-host = mirrors.aliyun.com index-url = http://mirrors.aliyun.com/pypi/simple
完成后成后,执行 sudo apt-get update更新软件包,然后再次执行 ./install.sh 安装脚本安装即可。
5 演示程序的操作说明
演示程序在安装后会在开机时自动运行,并默认显示 日期与时间 画面。
NanoHat OLED配件上的三个按键功能如下:
K1 -> 显示日期时间;
K2 -> 显示开发板的运行状态,例如 IP地址, 负载, 存储状态,CPU温度等信息;
K3 -> 关机操作,并不会立即关机,而是先弹出询问画面,在询问画面的状态下,用 K1 切换 Yes和No选项,K2进行确认;