Hi Everyone.
Since Micropython on Rak5010 published last week, more and more developers show great interest on it.
So we will publish Arduino on Rak5010 this week, it will be as popular as Micropython on Rak5010.
OK! Here we go!
-
What is Arduino?
If you know little about Arduino, please have a look below:
https://www.arduino.cc/ -
You have known Arduino. Install the IDE first:
https://www.arduino.cc/en/Main/Software -
What lib is used?
Rak5010 is based on nRF52840, so as Adafruit Feather nRF52840 Express. Therefore Arduino Core for Adafruit Bluefruit nRF52 Boards is suitable for Rak5010, except for the GPIO maping table. This makes it easily to transplant. Rak5010 use the lib of Adafruit and gpio maping of PCA10056. -
How to install Adafruit Bluefruit nRF52 in Arduino?
https://github.com/adafruit/Adafruit_nRF52_Arduino -
Check the other lib below install or not?
-
Download the gpio map of Rak5010 from:
https://github.com/RAKWireless/Arduino-on-Rak5010-
It contains gpio maping, serial tool, demo project and important hex.
-
PCA10056: GPIO maping of Rak5010
-
Serial tool: A good tool for debug
-
Rak5010.ino: Demo project
-
feather_nrf52840_express_bootloader-0.2.13_s140_6.1.1.hex : Hex include softdevice6.1.1 and bootloader support USB download from Arduino. It is a great method.
-
Replace your code with our code PCA10056, your code path maybe like:
C:\Program Files (x86)\Arduino\hardware\Adafruit\Adafruit_nRF52_Arduino\variants\pca10056 -
OK, development environment is finished. The next step is very important. Download the hex to Rak5010 with Jlink. It just need once.
-
Open the Rak5010.ino, connect Rak5010 to your pc via usb. It will be recognized as Adafruit Feather nRF52840 Express
.
-
Check the config, it should be like below:
-
Compile and download. Ingnore the Waring:
-
When download ok. Remember to remove the usb, open serial tool, insert usb, The demo project shows all sensors data on Rak5010 and a ble advertiser named “Rak5010”.
Notes:
The power up order is similar as power down order. So if download finish, change to serial tool directly, bg96 may power up fail. Secure order is:
Download—>remove usb(power down)—>insert usb—>open serial tool.