Compiled without error:
#include "ESP8266WiFi.h"
#include "UbidotsMicroESP8266.h"
#define TOKEN "YdtbEvgKnwVssEDK2wzMqmnGjuOnxU" // Put here your Ubidots TOKEN
#define WIFISSID "Untrusted-Network"
#define PASSWORD "12345"
Ubidots client(TOKEN);
void setup(){
Serial.begin(9600);
delay(10);
client.wifiConnection(WIFISSID, PASSWORD);
}
void loop(){
float value = analogRead(A0);
client.add("Temperature", value);
client.sendAll(true);
}
But while uploading to NodeMcu Lua ESP8266 CH340G ESP-12E
Uploading 237408 bytes from C:\Users\flash_os\AppData\Local\Temp\build8017001818300400212.tmp/sketch_jul29b.cpp.bin to flash at 0x00000000
error: failed sending 1072 bytes
...
.error: failed sending 1072 bytes
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_DATA) failed
warning: espcomm_send_command: wrong direction/command: 0x01 0x03, expected 0x01 0x04
error: espcomm_upload_mem failed
Code taken from:
http://ubidots.com/docs/devices/nodeMCU.html#send-one-value-to-ubidots
Followed by instruction:
http://ubidots.com/docs/devices/nodeMCU.html#setup