Ignore:
Timestamp:
Apr 2, 2016, 1:19:24 PM (8 years ago)
Author:
ertl-honda
Message:

クライアントの変更に対応

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtos_arduino/trunk/examples/ThingSpeak_basic/rca_app.cpp

    r206 r213  
    44#include "ThingSpeak.h"
    55
    6 #define SSID       ""
    7 #define PASSWORD   ""
     6#define STA_SSID       ""
     7#define STA_PASSWORD   ""
    88
    9 ESP8266Client wifi;
     9ESP8266Client wifi_client;
    1010
    1111void setup()
     
    1919    Serial.println(); Serial.println();
    2020    Serial.print("Connecting to ");
    21     Serial.println(SSID);
     21    Serial.println(STA_SSID);
    2222
    23     ret = wifi.begin(Serial5, 115200);
     23    ret = WiFi.begin(Serial5, 115200);
    2424
    2525    if(ret == 1) {
     
    2929        Serial.println("FW Version mismatch.");
    3030        Serial.print("FW Version:");
    31         Serial.println(wifi.getVersion().c_str());
     31        Serial.println(WiFi.getVersion().c_str());
    3232        Serial.print("Supported FW Version:");
    3333        Serial.println(ESP8266_SUPPORT_VERSION);
     
    3838
    3939    Serial.print("FW Version:");
    40     Serial.println(wifi.getVersion().c_str());
     40    Serial.println(WiFi.getVersion().c_str());
    4141   
    42     if (wifi.setOprToStation()) {
     42    if (WiFi.setOprToStation()) {
    4343        Serial.print("to station ok\r\n");
    4444    } else {
     
    4646    }
    4747   
    48     if (wifi.joinAP(SSID, PASSWORD)) {
     48    if (WiFi.joinAP(STA_SSID, STA_PASSWORD)) {
    4949        Serial.print("Join AP success\r\n");
    5050        Serial.print("IP: ");
    51         Serial.println(wifi.getLocalIP().c_str());   
     51        Serial.println(WiFi.getLocalIP().c_str());   
    5252    } else {
    5353        Serial.print("Join AP failure\r\n");
    5454    }
    5555
    56     if (wifi.stopServer()) {
     56    if (WiFi.stopServer()) {
    5757        Serial.print("Stop server ok\r\n");
    5858    } else {
     
    6060    }       
    6161   
    62     if (wifi.disableMUX()) {
     62    if (WiFi.disableMUX()) {
    6363        Serial.print("single ok\r\n");
    6464    } else {
     
    6767   
    6868    //Setup
    69     if (ThingSpeak.begin(wifi))  {
     69    if (ThingSpeak.begin(wifi_client))  {
    7070        Serial.print("ThingSpeak.begin() ok\r\n");
    7171    } else {
     
    7979}
    8080
    81 unsigned long myChannelNumber = ;
     81unsigned long myChannelNumber =
    8282const char * myWriteAPIKey = "";
    8383int cnt1;
     
    8686void loop() {
    8787    int ret;
     88
    8889    ThingSpeak.setField(1,cnt1);
    8990    ThingSpeak.setField(2,cnt2);
Note: See TracChangeset for help on using the changeset viewer.