Sigfox Networking Guide
Development website
  • Initial page
  • Introduction
  • Hardware
  • Software
  • Sigfox Back-End
  • When is Sigfox recommended?
  • Certifications
  • Code examples and extended information
  • API changelog
  • Documentation changelog
Powered by GitBook
On this page

Was this helpful?

Code examples and extended information

PreviousCertificationsNextAPI changelog

Last updated 5 years ago

Was this helpful?

In the Waspmote Development section you can find complete examples:

Example:

#include <WaspSigfox.h>

uint8_t socket = SOCKET0;
uint8_t error;

void setup()
{
  USB.ON(); 
  USB.println(F("Sigfox - Sending example"));
}

void loop()
{
  // 1. switch on
  error = Sigfox.ON(socket);

  // Check sending status
  if( error == 0 )
  {
    USB.println(F("Switch ON OK"));
  }
  else 
  {
    USB.println(F("Switch ON ERROR"));
  }
  
  
  // 2. send data
  
  USB.println(F("Sending a packet..."));
  
  // Send 12 bytes at most
  error = Sigfox.send("000102030405060708090A0B");
  
  // Check sending status
  if( error == 0 )
  {
    USB.println(F("Sigfox packet sent OK"));
  }
  else 
  {
    USB.println(F("Sigfox packet sent ERROR"));
  }
  
  
  // 3. sleep
  USB.println("\nEnter sleep");
  PWR.deepSleep("00:01:00:00",RTC_OFFSET,RTC_ALM1_MODE1,ALL_OFF);
  USB.println("\n***************************************");
}
ExamplesWaspmote
Logo