Download presentation
Presentation is loading. Please wait.
Published byAnastasia Henderson Modified over 9 years ago
1
Youn-Hee Han, Chan-Myung Kim {yhhan, cmdr}@koreatech.ac.kr Laboratory of Intelligent Networks Advanced Technology Research Center Korea University of Technology http://link.koreatech.ac.kr Ubiquitous Computing Practice (Wi-Fi)
2
/ 162 Introduction Arduino – Wifi Shield (Recommended)
3
/ 163 Introduction Arduino Wifi Shield (Recommended) Sparkfun Wifly Shield
4
/ 164 Arduino WiFi Shield http://arduino.cc/en/Main/ArduinoWiFiShield
5
/ 165 Wifi Library Wifi begin() disconnect() SSID() RSSI() … Server begin() available() write() println() … Client connected() connect() print() println() available() read() stop() … http://arduino.cc/en/Reference/WiFi
6
/ 166 Post Tweet. http://arduino-tweet.appspot.com/
7
/ 167 Setup if (WiFi.status() == WL_NO_SHIELD) { Serial.println("WiFi shield not present"); while(true); } while ( status != WL_CONNECTED) { Serial.print("Attempting to connect to SSID: "); Serial.println(ssid); status = WiFi.begin(ssid, key); delay(5000); }
8
/ 168 Encryption Open (No Encryption) char ssid[] = "yourNetwork"; int status = WiFi.begin(ssid); WPA char ssid[] = "yourNetwork"; char pw[] = “yourPassword"; int status = WiFi.begin(ssid, pw); WEP char ssid[] = "yourNetwork"; char key[] = "D0D0DEADF00DABBADEAFBEADED"; // ascii code int keyIndex = 0; int status = WiFi.begin(ssid, keyIndex, key);
9
/ 169 Post Tweet. char server_adr[] = "arduino-tweet.appspot.com"; char[] token = “2E6p1VBvd7oA3S9xPjmHYB7fB4xbEvIf8”; String tweet = “ 트윗 내용 ”; if (twtclient.connect(server_adr, 80)) { Serial.println("connected"); twtclient.println("POST http://arduino- tweet.appspot.com/update HTTP/1.0"); twtclient.print("Content-Length: "); twtclient.println(tweet.length()+strlen(token)+14); twtclient.println(); twtclient.print("token="); twtclient.print(token); twtclient.print("&status="); twtclient.println(tweet); }
10
/ 1610 Temperature + humidity
11
/ 1611 Temperature + humidity int indata0; int indata1; float RH; float sRH; float temperatureC; indata0 = analogRead(0); sRH = (indata0 / 1024.0) /0.0062 - 0.16 / 0.0062; temperatureC = analogRead(1) * 0.004882814; temperatureC = (temperatureC - 0.5) * 100; RH = sRH / (1.0546 - 0.00216 * temperatureC);
12
/ 1612 Indices Discomfort Index 1.8 * temperatureC - 0.55 * (1 - RH/100.0) * (1.8 * temperatureC - 26) + 32 Food Poisoning Index (1-exp(-exp(- 4.4946+0.0701*temperatureC+0.0152*RH)))*185.66+26.14 Deterioration Index ((RH-65)/14)*pow(1.054, temperatureC) http://www.kma.go.kr/weather/lifenindustry/life_01.jsp?JISU_INFO=life3_03
13
/ 1613 Post Tweet.
14
/ 1614 Thank You
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.