Skip to content

Instantly share code, notes, and snippets.

@ubi-gists
Last active November 7, 2019 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ubi-gists/6b0ff5ed698bc302587df12d158ae26e to your computer and use it in GitHub Desktop.
Save ubi-gists/6b0ff5ed698bc302587df12d158ae26e to your computer and use it in GitHub Desktop.
/*
* The sample code requires the ESP8266 v.2.0.0 library for proper operation.
* (https://github.com/ubidots/ubidots-esp8266/releases/tag/2.0.0)
* However, is strongly recommended to migrate the code to the latest library version.
* (https://github.com/ubidots/ubidots-esp8266)
*/
#include "UbidotsMicroESP8266.h"
#define ID "Your_variable_ID_here" // Put here your Ubidots variable ID
#define TOKEN "Your_token_here" // Put here your Ubidots TOKEN
Ubidots client(TOKEN);
void setup(){
Serial.begin(115200);
delay(10);
client.wifiConnection(WIFISSID, PASSWORD);
}
void loop(){
float value = analogRead(A0);
client.add(ID, value);
client.sendAll();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment