|
本帖最后由 nikoava 于 2016-5-9 18:52 编辑
利用esp8266作为wifi 发射站,将保存在nano的EEPROM内存中的温度数据传输到手提电脑或者手机上,设置 I 为地址,想通过修改I 最大值调节,来显示在网页上, 但无论我怎么修改 I 值,都只显示5个数据。求大神指教指教
- void sendMeasurement() {
- while(esp8266.available()) // check if the esp is sending a message
- {
- while(esp8266.find("+IPD,"))
- {
- delay(1000);
-
- int connectionId = esp8266.read()-48; // 减去 48 because the read() function returns
- // the ASCII 十进制值 and 0 (第一个十进制数) starts at 48
-
- String cipSend = "AT+CIPSEND=";//进入透传模式
- cipSend += connectionId;
- cipSend += ",";
- cipSend += 28;
- cipSend +="\r\n";
- sendData(cipSend,200,DEBUG);
- for(int i = 0; i < 30; i = i+2) {
- //i 是地址
- String webpage = String(EEPROM.read(i));
- webpage +=",";
- webpage += String(EEPROM.read(i+1));
- webpage += "\r\n";
-
- sendData(webpage,500,DEBUG);
- //把数据打印出来到网页上
-
- }
- String closeCommand = "AT+CIPCLOSE=";
- closeCommand+=connectionId; // 附加 connection id
- closeCommand+="\r\n";
-
- sendData(closeCommand,3000,DEBUG);
- }
- }
- }
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|