Skip to content

Instantly share code, notes, and snippets.

ubi-gists

Block or report user

Report or block ubi-gists

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View NodeMCU_ESP8266_MMC5883MA-B.ino
/*
* 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 <Wire.h>
#include "UbidotsMicroESP8266.h"
View UbiFunction_Thinxtra.js
/* Constants */
const request = require('request-promise');
const TOKEN = "PUT_YOUR_UBIDOTS_TOKEN_HERE"; // Assign your Ubidots TOKEN
/* Decodes the hex frame coming from the SigFox callback – Thinxtra device */
function decodeHexFrame(data) {
var buf = new Buffer.from(data, "hex");
var temperatura = buf.readInt16LE() / 100;
View energy_monitor.ino
// This #include statement was automatically added by the Particle IDE.
#include <Ubidots.h>
// This #include statement was automatically added by the Particle IDE.
#include <Current_Monitor.h>
#ifndef TOKEN
#define TOKEN "put_your_ubidots_token_here" // Put here your Ubidots TOKEN
#endif
View Ubidots_ArduinoWiFi_ControlLed.ino
/*************************************************************************************************
* This example get the last value of a variable from the Ubidots Cloud(www.ubidots.com) to control
* a Led.
*
* Requirements:
* 1. In the Device section, create a new device called "control"
* 2. Into the device just created, create a new default variable called "led"
* 3. In the Dashboard section, create a new "switch" control widget to control the led :)
*
* IMPORTANT NOTE: Don't forget assign your WiFi credentials, ubidots token, and the pin where the
View Ubidots_LevelSensor_ESP32_MQTT.ino
/*************************************************************************************************
* This Example sends harcoded data to Ubidots using a ESP32. The code sends a distance value
* between a device and its opposite endpoint to Ubidots, then the value will be managed in
* Ubidots to calculate the volume of a tank with the characteristics of your tank.
*
* This example is given AS IT IS without any warranty.
*
* Made by María Carlina Hernandez.
*************************************************************************************************/
@ubi-gists
ubi-gists / UbidotsAPI_PubNub_BLOCKS.js
Last active Jun 1, 2017
Manages data between Ubidots and PubNub
View UbidotsAPI_PubNub_BLOCKS.js
// https://ubidots.com/docs/api/index.html
export default (request) => {
const xhr = require('xhr');
const queryStringCodec = require('codec/query_string');
const token = request.message.token || '';
const apiKey = request.message.apiKey || '';
const action = request.message.action;
const payload = request.message.payload;
const labelDevice = request.message.labelDevice;
const variableLabel = request.message.variableLabel;
View PeopleCounter_NodeMCU.ino
// Made by: Maria Carlina Hernandez
/****************************************
* Include Libraries
****************************************/
#include "UbidotsESPMQTT.h"
/****************************************
* Define Constants
****************************************/
#define TOKEN "..." // Your Ubidots TOKEN
#define WIFINAME "..." //Your SSID
View SONOFF_Dual
/****************************************
* Include Libraries
****************************************/
#include "UbidotsESPMQTT.h"
/****************************************
* Define Constants
****************************************/
#define TOKEN "...." // Your Ubidots TOKEN
#define WIFINAME "...." //Your SSID
View Intel-Edison_Arduino.ino
/****************************************
* Include Libraries
****************************************/
#include <PubSubClient.h>
#include <SPI.h>
#include <WiFi.h>
/****************************************
* Define Your Wi-Fi crendetials
****************************************/
View Light_Control.ino
/****************************************
* Include Libraries
****************************************/
#include "UbidotsESPMQTT.h"
#include <Servo.h>
/****************************************
* Define Constants
****************************************/
#define TOKEN "assign_your_ubidots_token" // Your Ubidots TOKEN
You can’t perform that action at this time.