Skip to content

Software Overview

Arduino IDE

Note

For first-time users, who have never programmed before and are looking to use the Arduino IDE, we recommend beginning with the SparkFun Inventor's Kit (SIK), which includes a simpler board like the Arduino Uno or SparkFun RedBoard and is designed to help users get started programming with the Arduino IDE.

Most users may already be familiar with the Arduino IDE and its use. However, for those of you who have never heard the name Arduino before, feel free to check out the Arduino website. To get started with using the Arduino IDE, check out our tutorials below:

What is an Arduino?

What is an Arduino?

Installing Arduino IDE

Installing Arduino IDE

Installing an Arduino Library

Installing an Arduino Library

Installing Board Definitions in the Arduino IDE

Installing Board Definitions in the Arduino IDE

Install Board Definition

Which board definition you need depends on which MicroMod Processor Board you are using:

MicroMod ESP32 Processor Board Hookup Guide?

MicroMod ESP32 Processor Board Hookup Guide

MicroMod Artemis Processor Board Hookup Guide

MicroMod Artemis Processor Board Hookup Guide

MicroMod SAMD51 Processor Board Hookup Guide

MicroMod SAMD51 Processor Board Hookup Guide

MicroMod STM32 Processor Hookup Guide

MicroMod STM32 Processor Hookup Guide

MicroMod Teensy Processor Hookup Guide

MicroMod Teensy Processor Hookup Guide

MicroMod RP2040 Processor Board Hookup Guide

MicroMod RP2040 Processor Board Hookup Guide

MicroMod nRF52840 Processor Hookup Guide

MicroMod nRF52840 Processor Hookup Guide

SparkFun Swarm Satellite Arduino Library

Our SparkFun Swarm Satellite Arduino Library contains over 20 examples to get you up and running with Swarm Satellite and the M138 modem.

You can find the library through the Arduino IDE Library Manager. We recommend doing it this way, then you can update quickly and easily whenever we update the library.

  • Click on Tools\Manage Libraries... to open the library manager
  • In the search box, type SparkFun Swarm
  • Click the Install button to install the library

You can also download the latest library manually if you want to:

SparkFun Swarm Satellite Arduino Library (Zip)

Adapting the Library Examples to the SparkX Satellite Transceiver Function Board - Swarm M138

The SparkFun Swarm Satellite Arduino Library contains a full set of tried and tested examples which will run on any of our MicroMod Processor Boards.

The code below is a stripped-down version of Example3_getFirmwareVersion. Copy and paste the code into a new window in the Arduino IDE. Uncomment and adapt one of the #define swarmPowerEnablePin definitions to match your Main Board and Processor configuration:

#include <SparkFun_Swarm_Satellite_Arduino_Library.h> // http://librarymanager/All#SparkFun_Swarm_Satellite

SWARM_M138 mySwarm;

#define swarmSerial Serial1 // Use Serial1 to communicate with the modem. Change this if required.

// If you are using the Swarm Satellite Transceiver MicroMod Function Board:
//
// The Function Board has an onboard power switch which controls the power to the modem.
// The power is disabled by default.
// To enable the power, you need to pull the correct PWR_EN pin high.
//
// Uncomment and adapt a line to match your Main Board and Processor configuration:
//#define swarmPowerEnablePin A1 // MicroMod Main Board Single (DEV-18575) : with a Processor Board that supports A1 as an output
//#define swarmPowerEnablePin 39 // MicroMod Main Board Single (DEV-18575) : with e.g. the Teensy Processor Board using pin 39 (SDIO_DATA2) to control the power
//#define swarmPowerEnablePin 4  // MicroMod Main Board Single (DEV-18575) : with e.g. the Artemis Processor Board using pin 4 (SDIO_DATA2) to control the power
#define swarmPowerEnablePin G5 // MicroMod Main Board Double (DEV-18576) : Slot 0 with the ALT_PWR_EN0 set to G5<->PWR_EN0
//#define swarmPowerEnablePin G6 // MicroMod Main Board Double (DEV-18576) : Slot 1 with the ALT_PWR_EN1 set to G6<->PWR_EN1

void setup()
{
  // Swarm Satellite Transceiver MicroMod Function Board PWR_EN
  #ifdef swarmPowerEnablePin
  pinMode(swarmPowerEnablePin, OUTPUT); // Enable modem power 
  digitalWrite(swarmPowerEnablePin, HIGH);
  #endif

  Serial.begin(115200);

  if (mySwarm.begin(swarmSerial) == false) // Begin communication with the modem
  {
    Serial.println(F("Could not communicate with the modem. Please check the serial connections. Freezing..."));
    while (1)
      ;
  }

  char *firmwareVersion = new char[SWARM_M138_MEM_ALLOC_FV]; // Create storage for the configuration settings

  mySwarm.getFirmwareVersion(firmwareVersion); // Get the firmware version

  Serial.print(F("The firmware version is: "));
  Serial.println(firmwareVersion);

  delete[] firmwareVersion; // Free the storage
}

void loop()
{
  //Nothing to do here
}

Save the file and click on the Upload (arrow) button to upload the example onto your board.

Open Tools\Serial Monitor to see the modem firmware version.

Check that the baud rate is set to 115200.

Enjoy your SpaceBees!