Code examples and extended information

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***************************************");
}