【发布时间】:2016-07-26 18:09:38
【问题描述】:
我遇到了一个问题,我曾经使用代码成功地将数据发送到 Ubidots,但我现在无法发送它,我尝试使用另一个 Ubidots 帐户,它也不起作用。有人可以帮我解决这个问题,非常感谢您。 PS。该代码可以使设备连接WIFI,但不能向Ubidots发送数据。
#include "UbidotsWizFi250.h"
#define TOKEN "YNbIJdlwtH8s9p4xYNlZTuqhB6bfYY" // Replace it with your Ubidots token
#define ID "5795e2f876254249c8ce246a" // Replace it with your Ubidots' variable ID
#define WLAN_SSID "XXXXX" // Your WiFi SSID, cannot be longer than 32 characters!
#define WLAN_PASS "xxxxxxxxx" // Replace it with your WiFi pass
// Security can be OPEN, WEP, WPA, WPAAES, WPA2AES, WPA2TKIP, WPA2
#define WLAN_SECURITY "WPA2"
Ubidots client(TOKEN);
void setup() {
Serial.begin(9600);
while(!client.wifiConnection(WLAN_SSID, WLAN_PASS, WLAN_SECURITY));
}
void loop() {
int value = analogRead(A4);
client.add(ID,value);
client.sendAll();
Serial.println("--------------------");
delay(1000);
}
【问题讨论】:
标签: arduino-uno