Porting code from Electron to Boron

I have an older device built on the Electron that I just brought out of storage and tried to use again. It continues to flash rapid blue/cyan and won’t connect to the Cloud. The light bulb in my head just went off and I realize that the Electron may only support 3G cellular, which I’m guessing doesn’t exist here any more.

So I need to port my code from the Electron to a Boron. I’ve worked with the Boron before (love it) but the Electron uses several libraries and devices. In particular:

GPS (serial4/5 device), Older SH_BT Bluetooth board (serial1 device), Si7021 Temperature/Humidity sensor (I2C), Rotary encoder, Small OLED 128x64 Display

The libraries in use are:

#include <Adafruit_Si7021.h>
// This #include statement was automatically added by the Particle IDE.
#include <Grove_OLED_128x64.h>
// This #include statement was automatically added by the Spark IDE.
#include "AltGPS.h"
#include "Serial4/Serial4.h"
#include "Serial5/Serial5.h"
#include <Encoder.h>

I’ve had issues before finding libraries for what I though were common things. Sometimes, it’s just that the library name to search for isn’t obvious - and if you don’t know the right secret library name it appears that the library doesn’t exist when in fact it does exist under an unusual name.

Does any of this look like it’s going to be an issue porting to the Boron?

Thanks!

Libraries are generally compatible, however the Boron only has one UART serial port (Serial1). It does not have Serial2, Serial4, or Serial5 so any code that requires those hardware serial ports will not be compatible.

For GNSS, the best option is to use one that connects via I2C since that can be shared by multiple devices. The second best option is to use a SPI to UART bridge using the SC16IS7xxRK library.

If your Bluetooth board is doing Bluetooth LE you won’t need that as you can use the built-in BLE functionality.

Thanks! I’ll probably go with the SPI to UART or I2C to UART bridge idea.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.