天气预报员设计成功
Posted 极客阿正
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了天气预报员设计成功相关的知识,希望对你有一定的参考价值。
老早以前就想造一个天气站,就是通过esp8266的联网功能,做的网页POST与GET发包与接收,等考试结束了,我要好好研究一下他!!
是八是很强大???美美的
代码来一波》》》》》》》
1 //http://flash.weather.com.cn/wmaps/xml/nanjing.xml 2 //http://flash.weather.com.cn/wmaps/xml/zhengzhou.xml 3 //http://www.pm25.in/api/querys/pm2_5.json?city=nanjing&token=5j1znBVAsnSf5xQyNQyq 4 //http://www.pm25.in/api/querys/pm2_5.json?city=zhengzhou&token=郑州 5 #include <ESP8266WiFi.h> 6 #include <ESP8266HTTPClient.h> 7 #include <Adafruit_ssd1306syp.h> 8 #define SDA_PIN 4 9 #define SCL_PIN 2 10 char ssid[] = "maker_space"; // WiFi名 SSID (name) 11 char pass[] = "chuangke666"; // WiFi密码 12 /*---------------------------------------------------------------*/ 13 const byte sunny[] = { 14 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 15 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x20,0x00,0x00, 16 0x00,0x00,0x1C,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0xF0,0x00,0x00, 17 0x00,0x00,0x1E,0x00,0x01,0xF0,0x00,0x00,0x00,0x00,0x1F,0x03,0x01,0xE0,0x00,0x00, 18 0x00,0x00,0x0F,0x03,0x01,0xE0,0x00,0x00,0x00,0x00,0x0F,0x03,0x83,0xE0,0x00,0x00, 19 0x00,0x00,0x0F,0x83,0x83,0xC0,0x00,0x00,0x00,0x00,0x07,0x83,0x87,0xC0,0x00,0x00, 20 0x00,0x00,0x07,0xC0,0x07,0x80,0x00,0x00,0x00,0x00,0x03,0x80,0x03,0x80,0x00,0x00, 21 0x00,0x03,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x03,0x80,0x00,0x00,0x07,0x80,0x00, 22 0x00,0x03,0xC0,0x1F,0xE0,0x0F,0x00,0x00,0x00,0x01,0xC0,0x7F,0xFC,0x0E,0x00,0x00, 23 0x00,0x00,0x81,0xF8,0xFF,0x00,0x00,0x40,0x0F,0x00,0x03,0xC0,0x3F,0x80,0x03,0xE0, 24 0x1F,0xC0,0x07,0x00,0x1F,0xC0,0x0F,0xE0,0x0F,0xF0,0x0E,0x0F,0xFF,0xE0,0x3F,0xE0, 25 0x07,0xFC,0x1C,0x3F,0xFF,0xF0,0xFF,0xC0,0x01,0xFC,0x38,0x7F,0xFF,0xF8,0x7E,0x00, 26 0x00,0x7C,0x31,0xFF,0xFF,0xF8,0x78,0x00,0x00,0x08,0x71,0xFF,0xFF,0xFC,0x00,0x00, 27 0x00,0x00,0x63,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x63,0xFF,0xFF,0xFC,0x00,0x00, 28 0x00,0x00,0xE3,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0xE7,0xFF,0xFF,0xFE,0x1C,0x00, 29 0x00,0xF0,0xE7,0xFF,0xFF,0xFE,0x1F,0x00,0x01,0xF0,0xE7,0xFF,0xFF,0xFE,0x3F,0x00, 30 0x01,0xF0,0xE3,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0xE3,0xFF,0xFF,0xFE,0x00,0x00, 31 0x00,0x00,0xE3,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x73,0xFF,0xFF,0xFC,0x00,0x00, 32 0x00,0x00,0x7F,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x08,0x7F,0xFF,0xFF,0xFC,0x30,0x00, 33 0x00,0x3C,0x3F,0xFF,0xFF,0xF8,0x7C,0x00,0x01,0xFC,0x3F,0xFF,0xFF,0xF0,0x7F,0x80, 34 0x07,0xFE,0x1F,0xFF,0xFF,0xF0,0x7F,0xE0,0x0F,0xF8,0x0F,0xFF,0xFF,0xE0,0x1F,0xF0, 35 0x0F,0xC0,0x07,0xFF,0xFF,0xC0,0x03,0xE0,0x0F,0x00,0x03,0xFF,0xFF,0x80,0x00,0xE0, 36 0x00,0x00,0x40,0xFF,0xFE,0x06,0x00,0x00,0x00,0x00,0xE0,0x3F,0xF8,0x07,0x00,0x00, 37 0x00,0x01,0xE0,0x07,0xC0,0x07,0x80,0x00,0x00,0x03,0xC0,0x00,0x00,0x03,0x80,0x00, 38 0x00,0x03,0x80,0x00,0x00,0x81,0x80,0x00,0x00,0x00,0x03,0xC0,0x07,0xC0,0x00,0x00, 39 0x00,0x00,0x03,0xC1,0x87,0xC0,0x00,0x00,0x00,0x00,0x07,0xC3,0x83,0xC0,0x00,0x00, 40 0x00,0x00,0x07,0x83,0x83,0xE0,0x00,0x00,0x00,0x00,0x0F,0x83,0x81,0xE0,0x00,0x00, 41 0x00,0x00,0x0F,0x03,0x81,0xF0,0x00,0x00,0x00,0x00,0x1F,0x01,0x81,0xF0,0x00,0x00, 42 0x00,0x00,0x1E,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x1E,0x00,0x00,0xF0,0x00,0x00, 43 0x00,0x00,0x1E,0x00,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 44 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 45 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 46 }; 47 const byte cloudy[] = { 48 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x1C,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x1E,0x30,0xE0,0x00,0x00,0x00,0x00,0x00,0x0E,0x30,0xE0,0x00,0x00,0x00,0x00,0x00,0x06,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x3F,0xE0,0x00,0x00,0x0E,0x00,0x00,0x00,0xFF,0xFC,0x01,0xFF,0x0C,0x00,0x00,0x03,0xFF,0xFE,0x07,0x87,0xC0,0x04,0x00,0x07,0xC0,0x1F,0x84,0x03,0xE0,0x7E,0x00,0x0F,0x80,0x07,0x80,0xFF,0xF1,0xFE,0x00,0x1E,0x00,0x01,0xE0,0xFF,0xF8,0xE0,0x00,0x1C,0x00,0x01,0xE0,0x3F,0xF8,0x80,0x00,0x3C,0x00,0x03,0xFC,0x0F,0xFC,0x00,0x00,0x38,0x00,0x07,0xFE,0x0F,0xFC,0x00,0x00,0x30,0x00,0x1F,0xFF,0x07,0xFC,0x00,0x00,0x70,0x00,0x3E,0x07,0xC3,0xFC,0xF0,0x00,0x70,0x00,0x7C,0x03,0xC3,0xFC,0xF0,0x03,0xFE,0x00,0x78,0x01,0xF1,0xFC,0x00,0x07,0xFF,0x00,0x30,0x00,0xF1,0xFC,0x00,0x0F,0x87,0x00,0x00,0x00,0x70,0xF8,0x80,0x1E,0x00,0x00,0x00,0x00,0x70,0xF8,0xE0,0x1E,0x00,0x00,0x00,0x00,0x30,0xF1,0xF8,0x1C,0x00,0x00,0x00,0x00,0x30,0xF0,0xFE,0x18,0x00,0x00,0x00,0x00,0x30,0xC0,0x1E,0x18,0x00,0x00,0x00,0x00,0x70,0xC4,0x00,0x1C,0x00,0x00,0x00,0x00,0x70,0x0E,0x00,0x1C,0x00,0x00,0x00,0x00,0xF0,0x07,0x00,0x1E,0x03,0x80,0x00,0x01,0xE0,0xC0,0x00,0x1F,0x03,0xC0,0x08,0x03,0xC0,0xC0,0x00,0x0F,0x8F,0xE0,0x1E,0x07,0xC0,0xE0,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0x80,0xE0,0x00,0x03,0xFE,0xFF,0xFF,0xFE,0x00,0x70,0x00,0x00,0x00,0x0F,0xE1,0xF8,0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 49 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 50 }; 51 const byte cloudy2[] = { 52 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,java调天气预报