Difference between revisions of "BakeBit - NanoHat Hub/zh"

From FriendlyELEC WiKi
Jump to: navigation, search
(相关资料)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[BakeBit - NanoHat Hub/zh|查看中文]]
+
[[BakeBit - NanoHat Hub|English]]
 +
==介绍==
 +
* NanoHat Hub是一个专为NanoPi NEO/Air量身设计的接口扩展模块。NanoHat Hub通过I2C接口和NEO通讯,作为从设备的单片机MEGA328P扮演NEO和传感器模块之间翻译官的角色,翻译I2C总线上接收到的数据或命令并执行对应的操作。
 +
* NanoHat Hub提供了三个I2C接口、三个模拟接口,两个串口(一个NEO串口,一个单片机串口)和四个数字接口。
 +
* 连接NanoPi NEO/Air和传感器模块的扩展板,NanoHat Hub扩展板直接插在NanoPi NEO上面,所有的模块可以通过4个引脚的连接线直接连接到NanoHat Hub扩展板接口上,通过I2C接口、串口、数字/模拟接口建立传感器模块与NEO/Air之间的数据传输。
 +
*固件使用Arduino IDE集成开发环境开发,并完全开源。
 +
[[File:BakeBit - NEO Hub.jpg|thumb|BakeBit - NanoHat Hub]]
  
==Introduction==
+
==特性==
* The NanoHat-Hub is a plug & play extension board.The NanoHat-Hub communicate with the NanoPi NEO/AIR via its I2C interface. It acts as an interface between the NanoPi NEO/AIR and various external modules. The NanoHat-Hub has 3 I2C interfaces,3 analog interfaces,2 UART interfaces and 4 digital interfaces (among which D3 and D5 support PWM).All the BakeBit modules can be connected to the NanoHat-Hub with a 4-pin cable.
+
* 兼容NEO的尺寸和接口
* The NanoHat-Hub can be mounted on the NanoPi NEO/AIR with male connectors.The NanoHat-Hub communicates with various external modules via its I2C, serial and A/D interfaces.
+
* 3个2.0mm 4Pin I2C接口端子
* The NanoHat-Hub has 3 I2C interfaces,3 analog interfaces,2 UART interfaces and 4 digital interfaces (among which D3 and D5 support PWM).
+
* 3个2.0mm 4Pin 模拟接口端子
[[File:BakeBit - NEO Hub.jpg|thumb|BakeBit - NEO Hub]]
+
* 1个2.0mm URAT-NEO接口端子
 +
* 1个2.0mm URAT-Hub接口端子
 +
* 4个2.0mm 数字接口端子
 +
* PCB尺寸(mm):40x40
 +
* [http://wiki.friendlyarm.com/wiki/images/a/ad/2.0mm_smt_4pin.jpg 2.0mm 4Pin 接口端子尺寸文件]
  
==Hardware Spec==
+
[[File:BakeBit - NEO Hub_Top_PCB.png | frameless|350px|NanoHat Hub_Top]]
* Compatible with NanoPi NEO/AIR
+
[[File:BakeBit - NEO Hub_Bottom_PCB.png | frameless|350px|NanoHat Hub_Bottom]]
* 3 x 2.0mm pitch 4Pin I2C Interface
+
* 3 x 2.0mm pitch 4Pin Analog Interface
+
* 1 x 2.0mm pitch URAT-NEO Interface
+
* 1 x 2.0mm pitch URAT-Hub Interface
+
* 4 x 2.0mm pitch Digital Interface
+
* PCB dimension (mm): 40 x 40
+
[[File:BakeBit - NEO Hub_Top_PCB.png | frameless|350px|BakeBit - NEO Hub_Top]]
+
[[File:BakeBit - NEO Hub_Bottom_PCB.png | frameless|350px|BakeBit - NEO Hub_Bottom]]
+
  
* Pin Spec:
+
* 引脚说明:
* '''24 Pin Spec'''
+
* '''24 Pin排针引脚定义:'''
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 49: Line 51:
 
|}
 
|}
  
* '''12 Pin Spec'''
+
* '''12 Pin排针引脚定义:'''
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 61: Line 63:
 
|}
 
|}
  
[[File:BakeBit - NEO Hub1.jpg|thumb|600px|BakeBit - NEO Hub Interface]]
+
[[File:BakeBit - NEO Hub1.jpg|thumb|600px|BakeBit - NanoHat Hub接口]]
* Each BakeBit interface is a 2.0mm pitch 4pin connector. Here is its specification:
+
*每个BakeBit接口端子使用标准的2.0mm间距的4个引脚的插座,详细引脚定义如下所示:
  
* '''I2C Interface'''
+
* '''I2C接口引脚定义'''
There three 5V I2C interfaces on the top row. The first pin from the left is SCL and the second pin is SDA.
+
顶部一排(右图标识为1、2、3的接口)为3个5V电平的I2C接口,每个I2C接口的左侧第1个引脚为SCL,第2个引脚为SDA,第3个引脚为5V,第4个引脚为GND。
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
|Pin ||Name || Description
+
|引脚 ||名称 || 描述
 
|-
 
|-
 
|1 ||SCL  || SCL
 
|1 ||SCL  || SCL
Line 74: Line 76:
 
|2 || SDA  || SDA
 
|2 || SDA  || SDA
 
|-
 
|-
|3 || 5V    || 5V supply voltage
+
|3 || 5V    || 电源5V
 
|-
 
|-
|4 || GND  || Ground
+
|4 || GND  ||
 
|}
 
|}
* '''Analog Interface'''
+
* '''模拟接口引脚定义'''
There are three analog interfaces on the second row. The first pin from the left is An and the second pin is An+1. For example A0/A1 stands for the first pin A0 and the second pin A1 from the left. Usually it is abbreviated as A0.
+
第2排(右图标识为4、5、6的接口)为3个模拟接口,每个模拟接口的左侧第1个引脚为An,第2个引脚为An+1,第3个引脚为5V,第4个引脚为GND。<br />
 +
例如丝印为A0/A1的端子,表示端子的左侧第1个引脚为A0,第2个引脚为A1,习惯上为我们把这个A0/A1接口简称为模拟端子A0。
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
|Pin ||Name || Description
+
|引脚 ||名称 || 描述
 
|-
 
|-
|1 || An  || Analog An
+
|1 || An  || 模拟引脚An
 
|-
 
|-
|2 || An+1    || Analog An+1
+
|2 || An+1    || 模拟引脚An+1
 
|-
 
|-
|3 || 5V    || 5V supply voltage
+
|3 || 5V    || 电源5V
 
|-
 
|-
|4 || GND  || Ground
+
|4 || GND  ||
 
|}
 
|}
* '''UART Interface'''
+
* '''UART接口引脚定义'''
The NanoHat-Hub has two UART interfaces. When you connect the NanoHat-Hub to the NanoPi NEO/AIR the first UART on the third row from the left is directly connected to the NEO/AIR's UART1. The second UART is the UART populated from NanoHat-Hub's chipset and this UART can be used as D0/D1.
+
NanoHat Hub有2个UART接口,第3排的第1个(图上标识为7的接口)为NanoPi NEO板的UART口,第2个(图上标识为8的接口)为NanoHat Hub板的UART口。<br />
 +
另外,NanoHat Hub板的UART口可以作为数字接口D0/D1使用。<br />
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
|Pin ||Name || Description
+
|引脚 ||名称 || 描述
 
|-
 
|-
|1 ||Rx  || Receiver
+
|1 ||Rx  || 串口接收引脚
 
|-
 
|-
|2 || Tx    || Transmitter
+
|2 || Tx    || 串口发送引脚
 
|-
 
|-
|3 || 5V    || 5V supply voltage
+
|3 || 5V    || 电源5V
 
|-
 
|-
|4 ||  GND  || Ground
+
|4 ||  GND  ||
 
|}
 
|}
* '''Digital Interface'''
+
* '''数字接口引脚定义'''
The remaining four are digital interfaces. The fist from the left is Dn and the second is Dn+1. For example D2/D3 stands for the first pin D2 and the second pin D3 from the left. Usually it is abbreviated as D2.
+
其余的(图上标识为9、10、11、12的接口)接口为4个数字引脚接口,接口的左侧第1个引脚为Dn,第2个引脚为Dn+1,第3个引脚为5V,第4个引脚为GND。<br />
 
+
例如丝印为D2/D3的端子,表示接口的左侧第1个引脚为D2,第2个引脚为D3,习惯上为我们把这个接口D2/D3简称为数字端子D2。<br />
Among these 5 digital interfaces D2-D6 D3, D5 and D6 can be used as PWM.
+
5个数字引脚D2-D6中,引脚D3、D5、D6引脚可以作为PWM引脚使用。
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
|Pin ||Name || Description
+
|引脚 ||名称 || 描述
 
|-
 
|-
|1 || Dn  || Digital Interface Dn
+
|1 || Dn  || 数字引脚Dn
 
|-
 
|-
|2 || Dn+1    || Digital Interface Dn+1
+
|2 || Dn+1    || 数字引脚Dn+1
 
|-
 
|-
|3 || 5V    || 5V supply voltage
+
|3 || 5V    || 电源5V
 
|-
 
|-
|4 || GND  || Ground
+
|4 || GND  ||
 
|}
 
|}
  
==How To==
+
==使用方法==
BakeBit - Refer to this link for more details on how to connect the NanoHat Hub to the NanoPi NEO/AIR:[http://wiki.friendlyarm.com/wiki/index.php/BakeBit BakeBit - How to Connect NanoHat Hub to NanoPi NEO/AIR]
+
BakeBit - NanoHat Hub与NanoPi NEO/Air具有相同的尺寸,可直接堆叠在NanoPi NEO/Air上。<br \>
 +
BakeBit - NanoHat Hub连接NanoPi NEO/Air的使用方法参考以下链接:[http://wiki.friendlyarm.com/wiki/index.php/BakeBit/zh BakeBit - NanoHat Hub连接NanoPi NEO的使用方法]
  
==BakeBit Modules==
+
==支持的模块==
Here is a list of BakeBit modules that can work with the NanoHat Hub:
+
可以和BakeBit - NanoHat Hub连接使用的模块如下:
* 1、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Button Button]
+
* 1、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Button/zh 按键模块]
* 2、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Buzzer Buzzer]
+
* 2、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Buzzer/zh 蜂鸣器模块]
* 3、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Green_LED Green LED]
+
* 3、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Green_LED/zh 绿色LED模块]
* 4、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_JoyStick Joystick]
+
* 4、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_JoyStick/zh 摇杆模块]
* 5、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_LED_Bar LED Bar]
+
* 5、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_LED_Bar/zh LED Bar模块]
* 6、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Light_Sensor Light Sensor]
+
* 6、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Light_Sensor/zh 光敏模块]
* 7、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_OLED_128x64 OLED]
+
* 7、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_OLED_128x64/zh OLED模块]
* 8、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Red_LED Red LED]
+
* 8、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Red_LED/zh 红色LED模块]
* 9、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Rotary_Angle_Sensor Rotary Angle Module]
+
* 9、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Rotary_Angle_Sensor/zh 旋转角度模块]
* 10、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Servo servo]
+
* 10、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Servo/zh 舵机模块]
* 11、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Sound_Sensor Sound]
+
* 11、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Sound_Sensor/zh 声音模块]
* 12、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Ultrasonic_Ranger Ultrasonic Ranger]
+
* 12、[http://wiki.friendlyarm.com/wiki/index.php/BakeBit_-_Ultrasonic_Ranger/zh 超声波模块]
  
==Update NanoHat Hub's Firmware==
+
==升级NanoHat Hub固件==
You can update the chipset's firmware(bakebit_firmware.hex) of the NanoHat Hub by following the instructions below:<br />
+
升级BakeBit固件的实质是,将新版本的固件文件(名为bakebit_firmware.hex)烧写到NanoHat Hub的芯片内,下面的内容是具体的步骤: <br />
Install avrdude on NanoPi NEO/AIR's system:  
+
先在NanoPi NEO上安装 avrdude:  
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
apt-get install avrdude
 
apt-get install avrdude
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Append the following lines in the "/etc/avrdude.conf" file:
+
再用vi编辑配置文件 /etc/avrdude.conf,在文件最末尾加入如下内容:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
# Linux GPIO configuration for avrdude.  
 
# Linux GPIO configuration for avrdude.  
Line 163: Line 168:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Enter the "Firmware" directory and run the "firmware_update.sh" script to update the firmware:
+
然后进入Firmware目录,执行firmware_update.sh脚本上传固件:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd ~/BakeBit/Firmware  
 
cd ~/BakeBit/Firmware  
 
./firmware_update.sh  
 
./firmware_update.sh  
 
</syntaxhighlight>
 
</syntaxhighlight>
After a prompt shows up select "y". If the update is done successfully you will see the following messages:<br />
+
根据脚本的提示选择y,  固件更新成功的提示如下所示:<br />
 
[[File:BakeBit-UpdateFirmware.jpg|frameless|500px]]<br />
 
[[File:BakeBit-UpdateFirmware.jpg|frameless|500px]]<br />
The firmware is a ".hex" binary file and you can check the latest version by running the "new_fw_search.sh" script.<br />
+
正如你所见,固件是一个名为.hex的二进制文件,你可以使用脚本 new_fw_search.sh 在线检查一下官方是否有新版本。<br />
  
==Compile Firmware with Arduino IDE==
+
==使用Arduino IDE编译固件==
1) Download the Arduino IDE from the following link and install it on your host PC:<br />
+
1) 先在电脑上安装Arduino IDE,Arduino IDE到这里下载: <br />
 
https://www.arduino.cc/en/Main/Software<br />
 
https://www.arduino.cc/en/Main/Software<br />
 
<br />
 
<br />
2) The Arduino IDE's installation directory has a "libraries" directory. Copy the whole "BakeBit/Firmware/Source/FastLED-FastLED3.1" directory to the "libraries" directory. In MacOS the libraries directory is "/Applications/Arduino.app/Contents/Java/libraries/"<br />
+
2) 把BakeBit/Firmware/Source/下的FastLED-FastLED3.1目录复制到Arduino IDE安装目录下的libraries子目录,在macOS下该路径为: /Applications/Arduino.app/Contents/Java/libraries/ <br />
 
<br />
 
<br />
3) Open the BakeBit project file in Arduino IDE:<br />
+
3) 用Arduino IDE打开BakeBit项目文件:<br />
 
BakeBit/Firmware/Source/bakebit_v1.0.0/bakebit_v1.0.0.ino<br />
 
BakeBit/Firmware/Source/bakebit_v1.0.0/bakebit_v1.0.0.ino<br />
 
<br />
 
<br />
4) In the main Arduino GUI open the "Tools" menu and change the Board model to "Arduino Nano":<br />
+
4) 在Arduino上进入Tools菜单,把Board的类型改为Arduino Nano:<br />
 
[[File:BakeBit-ArduinoBoardType.jpg|frameless|500px]]<br />
 
[[File:BakeBit-ArduinoBoardType.jpg|frameless|500px]]<br />
5) In the main Arduino GUI open the "Sketch" menu, select "Export Compiled Binary" to start compilation.<br /> <br />
+
5) 在Arduino上进入Sketch菜单,选择 Export Compliled Binary,Arduino将执行编译。<br /> <br />
6) If the compilation succeeds a binary file "bakebit_v1.0.0.ino.eightanaloginputs.hex" will be generated. Rename the file to "bakebit_firmware.hex", upload it to "NanoPi NEO" and replace the file with the same name under the "BakeBit/Firmware/" directory. Follow the instructions in the previous section to run the firmware_update.sh script to flash the firmware.<br />
+
6) 编译成功后,在源代码目录下, 会生成一个名为bakebit_v1.0.0.ino.eightanaloginputs.hex的二进制文件,将其更名为 bakebit_firmware.hex,上传到NanoPi NEO上并覆盖BakeBit/Firmware/下的同名文件,用上一章节介绍的方法,执行firmware_update.sh脚本重新烧写固件即可。 <br />
 
+
==Resources==
+
*[Schematic]([http://wiki.friendlyarm.com/wiki/images/4/41/SCHEMATIC1_NEO-Hub.pdf BakeBit - NEO Hub.pdf])
+
*[Dimensional]([http://wiki.friendlyarm.com/wiki/index.php/File:NEO_Hub.dxf BakeBit - NEO Hub Dimensional.dxf])
+
 
+
==Update Log==
+
===Dec-09-2016===
+
* Released English Version
+
  
===Jan-19-2016===
+
==相关资料==
* Renamed "NEO-Hub" to "NanoHat-Hub"
+
*[Schematic]([http://wiki.friendlyarm.com/wiki/images/6/60/SCHEMATIC_NanoHat-Hub.pdf SCHEMATIC_NanoHat Hub.pdf])
 +
*[Dimensional]([http://wiki.friendlyarm.com/wiki/index.php/File:Dimensional_NanoHat_Hub.dxf Dimensional_NanoHat Hub.dxf])
 +
*[Dimensional]([http://wiki.friendlyarm.com/wiki/images/a/ad/2.0mm_smt_4pin.jpg 2.0mm 4Pin 接口尺寸图])

Latest revision as of 01:57, 5 July 2018

English

1 介绍

  • NanoHat Hub是一个专为NanoPi NEO/Air量身设计的接口扩展模块。NanoHat Hub通过I2C接口和NEO通讯,作为从设备的单片机MEGA328P扮演NEO和传感器模块之间翻译官的角色,翻译I2C总线上接收到的数据或命令并执行对应的操作。
  • NanoHat Hub提供了三个I2C接口、三个模拟接口,两个串口(一个NEO串口,一个单片机串口)和四个数字接口。
  • 连接NanoPi NEO/Air和传感器模块的扩展板,NanoHat Hub扩展板直接插在NanoPi NEO上面,所有的模块可以通过4个引脚的连接线直接连接到NanoHat Hub扩展板接口上,通过I2C接口、串口、数字/模拟接口建立传感器模块与NEO/Air之间的数据传输。
  • 固件使用Arduino IDE集成开发环境开发,并完全开源。
BakeBit - NanoHat Hub

2 特性

  • 兼容NEO的尺寸和接口
  • 3个2.0mm 4Pin I2C接口端子
  • 3个2.0mm 4Pin 模拟接口端子
  • 1个2.0mm URAT-NEO接口端子
  • 1个2.0mm URAT-Hub接口端子
  • 4个2.0mm 数字接口端子
  • PCB尺寸(mm):40x40
  • 2.0mm 4Pin 接口端子尺寸文件

NanoHat Hub_Top NanoHat Hub_Bottom

  • 引脚说明:
  • 24 Pin排针引脚定义:
Pin# Name Pin# Name
1 SYS_3.3V 2 VDD_5V
3 I2C0_SDA 4 VDD_5V
5 I2C0_SCL 6 GND
7 GPIOG11 8 UART1_TX/GPIOG6
9 GND 10 UART1_RX/GPIOG7
11 UART2_TX/GPIOA0 12 PWM1/GPIOA6
13 UART2_RTS/GPIOA2 14 GND
15 UART2_CTS/GPIOA3 16 UART1_RTS/GPIOG8
17 SYS_3.3V 18 UART1_CTS/GPIOG9
19 SPI0_MOSI/GPIOC0 20 GND
21 SPI0_MISO/GPIOC1 22 UART2_RX/GPIOA1
23 SPI0_CLK/GPIOC2 24 SPI0_CS/GPIOC3
  • 12 Pin排针引脚定义:
Pin# Name Description
1 VDD_5V 5V Power In/Out
2---11 NC Not Connected
12 GND 0V
BakeBit - NanoHat Hub接口
  • 每个BakeBit接口端子使用标准的2.0mm间距的4个引脚的插座,详细引脚定义如下所示:
  • I2C接口引脚定义

顶部一排(右图标识为1、2、3的接口)为3个5V电平的I2C接口,每个I2C接口的左侧第1个引脚为SCL,第2个引脚为SDA,第3个引脚为5V,第4个引脚为GND。

引脚 名称 描述
1 SCL SCL
2 SDA SDA
3 5V 电源5V
4 GND
  • 模拟接口引脚定义

第2排(右图标识为4、5、6的接口)为3个模拟接口,每个模拟接口的左侧第1个引脚为An,第2个引脚为An+1,第3个引脚为5V,第4个引脚为GND。
例如丝印为A0/A1的端子,表示端子的左侧第1个引脚为A0,第2个引脚为A1,习惯上为我们把这个A0/A1接口简称为模拟端子A0。

引脚 名称 描述
1 An 模拟引脚An
2 An+1 模拟引脚An+1
3 5V 电源5V
4 GND
  • UART接口引脚定义

NanoHat Hub有2个UART接口,第3排的第1个(图上标识为7的接口)为NanoPi NEO板的UART口,第2个(图上标识为8的接口)为NanoHat Hub板的UART口。
另外,NanoHat Hub板的UART口可以作为数字接口D0/D1使用。

引脚 名称 描述
1 Rx 串口接收引脚
2 Tx 串口发送引脚
3 5V 电源5V
4 GND
  • 数字接口引脚定义

其余的(图上标识为9、10、11、12的接口)接口为4个数字引脚接口,接口的左侧第1个引脚为Dn,第2个引脚为Dn+1,第3个引脚为5V,第4个引脚为GND。
例如丝印为D2/D3的端子,表示接口的左侧第1个引脚为D2,第2个引脚为D3,习惯上为我们把这个接口D2/D3简称为数字端子D2。
5个数字引脚D2-D6中,引脚D3、D5、D6引脚可以作为PWM引脚使用。

引脚 名称 描述
1 Dn 数字引脚Dn
2 Dn+1 数字引脚Dn+1
3 5V 电源5V
4 GND

3 使用方法

BakeBit - NanoHat Hub与NanoPi NEO/Air具有相同的尺寸,可直接堆叠在NanoPi NEO/Air上。
BakeBit - NanoHat Hub连接NanoPi NEO/Air的使用方法参考以下链接:BakeBit - NanoHat Hub连接NanoPi NEO的使用方法

4 支持的模块

可以和BakeBit - NanoHat Hub连接使用的模块如下:

5 升级NanoHat Hub固件

升级BakeBit固件的实质是,将新版本的固件文件(名为bakebit_firmware.hex)烧写到NanoHat Hub的芯片内,下面的内容是具体的步骤:
先在NanoPi NEO上安装 avrdude:

apt-get install avrdude

再用vi编辑配置文件 /etc/avrdude.conf,在文件最末尾加入如下内容:

# Linux GPIO configuration for avrdude. 
# Change the lines below to the GPIO pins connected to the AVR. 
programmer 
  id    = "nanopineo"; 
  desc  = "Use the Linux sysfs interface to bitbang GPIO lines"; 
  type  = "linuxgpio"; 
  reset = 67; 
  sck   = 66; 
  mosi  = 64; 
  miso  = 65; 
;

然后进入Firmware目录,执行firmware_update.sh脚本上传固件:

cd ~/BakeBit/Firmware 
./firmware_update.sh

根据脚本的提示选择y, 固件更新成功的提示如下所示:
BakeBit-UpdateFirmware.jpg
正如你所见,固件是一个名为.hex的二进制文件,你可以使用脚本 new_fw_search.sh 在线检查一下官方是否有新版本。

6 使用Arduino IDE编译固件

1) 先在电脑上安装Arduino IDE,Arduino IDE到这里下载:
https://www.arduino.cc/en/Main/Software

2) 把BakeBit/Firmware/Source/下的FastLED-FastLED3.1目录复制到Arduino IDE安装目录下的libraries子目录,在macOS下该路径为: /Applications/Arduino.app/Contents/Java/libraries/

3) 用Arduino IDE打开BakeBit项目文件:
BakeBit/Firmware/Source/bakebit_v1.0.0/bakebit_v1.0.0.ino

4) 在Arduino上进入Tools菜单,把Board的类型改为Arduino Nano:
BakeBit-ArduinoBoardType.jpg
5) 在Arduino上进入Sketch菜单,选择 Export Compliled Binary,Arduino将执行编译。

6) 编译成功后,在源代码目录下, 会生成一个名为bakebit_v1.0.0.ino.eightanaloginputs.hex的二进制文件,将其更名为 bakebit_firmware.hex,上传到NanoPi NEO上并覆盖BakeBit/Firmware/下的同名文件,用上一章节介绍的方法,执行firmware_update.sh脚本重新烧写固件即可。

7 相关资料