Send Simple Data to Antares

The following is the source code to connect the Arduino Uno Ethernet Shield with Antares using the Arduino IDE.

After you have finished configuring, it's time to create a program code to send simple data to the device on the Antares console that you have created previously. You can get the programme code in the example directory in the Antares Ethernet Shield library folder that you have downloaded previously or you can easily get it by clicking File > Examples > AntaresEthernetShield > Send_Data in the Arduino IDE.

The AntaresEthernetShield programme code is as follows. Don't forget to type the Access Key applicationname and Device Id that you use in your Antares account console. After that upload the programme and wait a few seconds.

#include "AntaresEthernetShield.h"

#define ACCESSKEY "your-access-key"
#define applicationName "your-application-name"
#define deviceName "your-device-name"

unsigned int counter =0;

AntaresEthernetShield antares(ACCESSKEY);

void setup() {
Serial.begin(9600);
antares.StartConnection();
}
void loop() { 
String text ="Hello! ";
text += String(counter);
counter++;
antares.sendData(text, applicationName, deviceName);
delay(10000);
}            

After the programme code upload process is complete, please check the data entered on the Antares Device that you have previously created. If successful, the display on your device will look like the following:

Last updated