Skip to content

Instantly share code, notes, and snippets.

@refugeesus
Created November 15, 2017 20:52
Show Gist options
  • Save refugeesus/3cdbc6ddadcaaa302e0f689da9155898 to your computer and use it in GitHub Desktop.
Save refugeesus/3cdbc6ddadcaaa302e0f689da9155898 to your computer and use it in GitHub Desktop.
/*
* Copyright 2017, Helium Systems, Inc.
* All Rights Reserved. See LICENCE.txt for license information
*/
#include "Arduino.h"
#include "Board.h"
#include "Helium.h"
#include "HeliumUtil.h"
// NOTE: Please ensure you've created a channel with the above
// CHANNEL_NAME as it's name.
#define CHANNEL_NAME "googleiot-test"
Helium helium(&atom_serial);
Channel channel(&helium);
void
setup()
{
Serial.begin(9600);
DBG_PRINTLN(F("Starting"));
// Begin communication with the Helium Atom
helium.begin(HELIUM_BAUD_RATE);
// Connect the Atom to the Helium Network
helium_connect(&helium);
channel_create(&channel, CHANNEL_NAME);
}
void
loop()
{
const char * data = "Hello Helium!";
// Send data to channel
channel_send(&channel, CHANNEL_NAME, data, strlen(data));
// Wait about 5 seconds
delay(5000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment