Programming & libraries

For programming any LowPowerLab boards, you need to install the Moteino package in your Arduino IDE – this includes definitions for all Moteino boards, MightyHat, CurrentRanger etc. First add the Moteino core json definition URL to your Board Manager.

Then in Board Manager you will see AVR and SAMD boards by LowPowerLab.

For AVR based Moteinos and MightyHat you need to install the Moteino AVR Boards package. For MoteinoM0 you need to install the Moteino SAMD Boards.

For SAMD based boards (ex. MoteinoM0, CurrentRanger) you need to also ensure you have the official Arduino SAMD Boards package installed in your Arduino IDE (in addition to the Moteino SAMD Boards package):

Once the required packages are installed the new boards will show in your Tools>Boards menu:

There is now a programming guide for Moteinos which helps you get started with libraries and programming in Arduino IDE, please check it out if you are new to Arduino. Quick steps to programming in the Arduino IDE:

  • First, you need to download and install the necessary libraries in your Arduino/libraries folder: RFM69 library, SPIFlash library, you can use the Arduino Library Manager (unde Tools > Manage Libraries menu) to install the latest version of these libraries:
  • For RFM95/96 LoRa radios please see the LoRa section of this guide
  • Get started with RFM69 example sketches: Sender and Receiver
  • To upload a sketch, select Moteino in the Tools>Boards menu in the Arduino IDE, and the serial port emulated by your FTDI-Adapter or USB-serial adapter in Tools>Serial Port. Note that choosing Arduino Uno as the target board should also work for AVR Moteinos based on Atmega328, but some pin definitions (like the LED_BUILTIN) are different.
An FTDI-Adapter that can be used to program Moteinos (non USB variants). If you have any board with built in USB (ex. MoteinoUSB, MoteinoMEGA-USB, MoteinoM0) a separate FTDI-Adapter is not necessary

The VIN pin of AVR Moteinos is shared with the VIN pin on the FTDI header. If you power your Moteino externally from the VIN pin, make sure to disconnect the external source when you attach the FTDI-Adapter!

The FTDI header has silkscreen markings for the GND and DTR pins to help you align your FTDI Adapter (black and green wires respectively on the FTDI cable). Usually the PCB based FTDI adapters also have the same markings on their end (see the FTDI Adapter).

The Moteino can be used like Arduino, but for wireless communications you will need a library for the RFM69 transceiver. You can use the official RFM69 library for RFM69 Moteinos, it has a suite of examples to get you started.  The simplest way is to start with the Node and Gateway examples. For RFM95/96 LoRa transceivers please see this section for more details. See this official tutorial on installing Arduino libraries if you’re not sure how to install an Arduino library.