Soumettre la recherche
Mettre en ligne
Arduino Yun 物聯網 Lesson 3
•
Télécharger en tant que PPTX, PDF
•
10 j'aime
•
6,146 vues
CAVEDU Education
Suivre
認識DHT11數位溫溼度感測器。 將此資料傳送至Google Docs試算表 自動寄送電子郵件
Lire moins
Lire la suite
Périphériques & matériel
Signaler
Partager
Signaler
Partager
1 sur 62
Télécharger maintenant
Recommandé
Arduino Yun 物聯網 Lesson 2
Arduino Yun 物聯網 Lesson 2
CAVEDU Education
使用 DesignSpark PCB 軟體製作感應燈電路板
使用 DesignSpark PCB 軟體製作感應燈電路板
CAVEDU Education
第三章Ti msp430平台介紹 v3
第三章Ti msp430平台介紹 v3
冠宇 陳
Processing on your Android
Processing on your Android
CAVEDU Education
Arduino Yun 物聯網 Lesson 1
Arduino Yun 物聯網 Lesson 1
CAVEDU Education
LinkIt ONE tutorial #1- Basics
LinkIt ONE tutorial #1- Basics
CAVEDU Education
LinkIt 7697 IoT tutorial
LinkIt 7697 IoT tutorial
CAVEDU Education
Arduino Yun Mini簡介
Arduino Yun Mini簡介
Wei-Tsung Su
Recommandé
Arduino Yun 物聯網 Lesson 2
Arduino Yun 物聯網 Lesson 2
CAVEDU Education
使用 DesignSpark PCB 軟體製作感應燈電路板
使用 DesignSpark PCB 軟體製作感應燈電路板
CAVEDU Education
第三章Ti msp430平台介紹 v3
第三章Ti msp430平台介紹 v3
冠宇 陳
Processing on your Android
Processing on your Android
CAVEDU Education
Arduino Yun 物聯網 Lesson 1
Arduino Yun 物聯網 Lesson 1
CAVEDU Education
LinkIt ONE tutorial #1- Basics
LinkIt ONE tutorial #1- Basics
CAVEDU Education
LinkIt 7697 IoT tutorial
LinkIt 7697 IoT tutorial
CAVEDU Education
Arduino Yun Mini簡介
Arduino Yun Mini簡介
Wei-Tsung Su
成果展簡報-Zigbee無線自動燈光及溫度調控系統
成果展簡報-Zigbee無線自動燈光及溫度調控系統
艾鍗科技
設定Arduino Yún WiFi連線
設定Arduino Yún WiFi連線
吳錫修 (ShyiShiou Wu)
nodeMCU IOT教學03 - NodeMCU導論
nodeMCU IOT教學03 - NodeMCU導論
吳錫修 (ShyiShiou Wu)
GPS + Google fusion table 雲端應用
GPS + Google fusion table 雲端應用
艾鍗科技
160603 T客邦7688物聯網實作坊
160603 T客邦7688物聯網實作坊
CAVEDU Education
Arduino Yún使用網頁顯示監測資料
Arduino Yún使用網頁顯示監測資料
吳錫修 (ShyiShiou Wu)
瞻營全電子_六足機器人(二)
瞻營全電子_六足機器人(二)
CAVEDU Education
更新Arduino Yún OS
更新Arduino Yún OS
吳錫修 (ShyiShiou Wu)
保全機器人與居家防護系統實作
保全機器人與居家防護系統實作
艾鍗科技
使用console訊息操作Arduino Yún IO
使用console訊息操作Arduino Yún IO
吳錫修 (ShyiShiou Wu)
LinkIt Smart 7688 Duo and MCS basics
LinkIt Smart 7688 Duo and MCS basics
CAVEDU Education
LinkIt 7697 開發平台簡介 (Traditional Chinese)
LinkIt 7697 開發平台簡介 (Traditional Chinese)
Bear Wang
艾鍗學院-健康照護手環
艾鍗學院-健康照護手環
艾鍗科技
Arduino相關型錄
Arduino相關型錄
CAVEDU Education
物聯網技術分享 使用ESP8266
物聯網技術分享 使用ESP8266
Power Wu
UniArgus internet cam (UniArgus uic)軟體產品簡介與軟一次性體使用授權
UniArgus internet cam (UniArgus uic)軟體產品簡介與軟一次性體使用授權
HermesDDS
Otto97完全製作手冊 v0.9
Otto97完全製作手冊 v0.9
Bear Wang
Arduino簡介
Arduino簡介
吳錫修 (ShyiShiou Wu)
Arduino藍牙傳輸應用
Arduino藍牙傳輸應用
吳錫修 (ShyiShiou Wu)
Processing / Android / Arduino
Processing / Android / Arduino
CAVEDU Education
使用Arduino Yún內建Web伺服器
使用Arduino Yún內建Web伺服器
吳錫修 (ShyiShiou Wu)
Arduino Yún使用sd card儲存監測資料
Arduino Yún使用sd card儲存監測資料
吳錫修 (ShyiShiou Wu)
Contenu connexe
Tendances
成果展簡報-Zigbee無線自動燈光及溫度調控系統
成果展簡報-Zigbee無線自動燈光及溫度調控系統
艾鍗科技
設定Arduino Yún WiFi連線
設定Arduino Yún WiFi連線
吳錫修 (ShyiShiou Wu)
nodeMCU IOT教學03 - NodeMCU導論
nodeMCU IOT教學03 - NodeMCU導論
吳錫修 (ShyiShiou Wu)
GPS + Google fusion table 雲端應用
GPS + Google fusion table 雲端應用
艾鍗科技
160603 T客邦7688物聯網實作坊
160603 T客邦7688物聯網實作坊
CAVEDU Education
Arduino Yún使用網頁顯示監測資料
Arduino Yún使用網頁顯示監測資料
吳錫修 (ShyiShiou Wu)
瞻營全電子_六足機器人(二)
瞻營全電子_六足機器人(二)
CAVEDU Education
更新Arduino Yún OS
更新Arduino Yún OS
吳錫修 (ShyiShiou Wu)
保全機器人與居家防護系統實作
保全機器人與居家防護系統實作
艾鍗科技
使用console訊息操作Arduino Yún IO
使用console訊息操作Arduino Yún IO
吳錫修 (ShyiShiou Wu)
LinkIt Smart 7688 Duo and MCS basics
LinkIt Smart 7688 Duo and MCS basics
CAVEDU Education
LinkIt 7697 開發平台簡介 (Traditional Chinese)
LinkIt 7697 開發平台簡介 (Traditional Chinese)
Bear Wang
艾鍗學院-健康照護手環
艾鍗學院-健康照護手環
艾鍗科技
Arduino相關型錄
Arduino相關型錄
CAVEDU Education
物聯網技術分享 使用ESP8266
物聯網技術分享 使用ESP8266
Power Wu
UniArgus internet cam (UniArgus uic)軟體產品簡介與軟一次性體使用授權
UniArgus internet cam (UniArgus uic)軟體產品簡介與軟一次性體使用授權
HermesDDS
Otto97完全製作手冊 v0.9
Otto97完全製作手冊 v0.9
Bear Wang
Arduino簡介
Arduino簡介
吳錫修 (ShyiShiou Wu)
Arduino藍牙傳輸應用
Arduino藍牙傳輸應用
吳錫修 (ShyiShiou Wu)
Processing / Android / Arduino
Processing / Android / Arduino
CAVEDU Education
Tendances
(20)
成果展簡報-Zigbee無線自動燈光及溫度調控系統
成果展簡報-Zigbee無線自動燈光及溫度調控系統
設定Arduino Yún WiFi連線
設定Arduino Yún WiFi連線
nodeMCU IOT教學03 - NodeMCU導論
nodeMCU IOT教學03 - NodeMCU導論
GPS + Google fusion table 雲端應用
GPS + Google fusion table 雲端應用
160603 T客邦7688物聯網實作坊
160603 T客邦7688物聯網實作坊
Arduino Yún使用網頁顯示監測資料
Arduino Yún使用網頁顯示監測資料
瞻營全電子_六足機器人(二)
瞻營全電子_六足機器人(二)
更新Arduino Yún OS
更新Arduino Yún OS
保全機器人與居家防護系統實作
保全機器人與居家防護系統實作
使用console訊息操作Arduino Yún IO
使用console訊息操作Arduino Yún IO
LinkIt Smart 7688 Duo and MCS basics
LinkIt Smart 7688 Duo and MCS basics
LinkIt 7697 開發平台簡介 (Traditional Chinese)
LinkIt 7697 開發平台簡介 (Traditional Chinese)
艾鍗學院-健康照護手環
艾鍗學院-健康照護手環
Arduino相關型錄
Arduino相關型錄
物聯網技術分享 使用ESP8266
物聯網技術分享 使用ESP8266
UniArgus internet cam (UniArgus uic)軟體產品簡介與軟一次性體使用授權
UniArgus internet cam (UniArgus uic)軟體產品簡介與軟一次性體使用授權
Otto97完全製作手冊 v0.9
Otto97完全製作手冊 v0.9
Arduino簡介
Arduino簡介
Arduino藍牙傳輸應用
Arduino藍牙傳輸應用
Processing / Android / Arduino
Processing / Android / Arduino
En vedette
使用Arduino Yún內建Web伺服器
使用Arduino Yún內建Web伺服器
吳錫修 (ShyiShiou Wu)
Arduino Yún使用sd card儲存監測資料
Arduino Yún使用sd card儲存監測資料
吳錫修 (ShyiShiou Wu)
物聯網教學與上海深圳maker行
物聯網教學與上海深圳maker行
CAVEDU Education
Arduino Yún使用Temboo服務
Arduino Yún使用Temboo服務
吳錫修 (ShyiShiou Wu)
Arduino Yún使用Http client
Arduino Yún使用Http client
吳錫修 (ShyiShiou Wu)
Arduino 習作工坊 - Lesson 2 動力之夜
Arduino 習作工坊 - Lesson 2 動力之夜
CAVEDU Education
Unity遊戲程式設計(04) 2D運動與碰撞處理I
Unity遊戲程式設計(04) 2D運動與碰撞處理I
吳錫修 (ShyiShiou Wu)
Arduino AMA中級認證術科實作 all
Arduino AMA中級認證術科實作 all
吳錫修 (ShyiShiou Wu)
Unity遊戲程式設計(01) Unity簡介
Unity遊戲程式設計(01) Unity簡介
吳錫修 (ShyiShiou Wu)
Unity遊戲程式設計(09) 3D物件與光源設定
Unity遊戲程式設計(09) 3D物件與光源設定
吳錫修 (ShyiShiou Wu)
mBot 教學7 聲光控制應用
mBot 教學7 聲光控制應用
吳錫修 (ShyiShiou Wu)
Mbot教學(1b) mBot初體驗
Mbot教學(1b) mBot初體驗
吳錫修 (ShyiShiou Wu)
mBot 教學5 超音波感測應用
mBot 教學5 超音波感測應用
吳錫修 (ShyiShiou Wu)
mBot 教學6 光感測器與LED應用
mBot 教學6 光感測器與LED應用
吳錫修 (ShyiShiou Wu)
Arduino、Web 到 IoT
Arduino、Web 到 IoT
Justin Lin
Introduction to Arduino Programming
Introduction to Arduino Programming
James Lewis
En vedette
(16)
使用Arduino Yún內建Web伺服器
使用Arduino Yún內建Web伺服器
Arduino Yún使用sd card儲存監測資料
Arduino Yún使用sd card儲存監測資料
物聯網教學與上海深圳maker行
物聯網教學與上海深圳maker行
Arduino Yún使用Temboo服務
Arduino Yún使用Temboo服務
Arduino Yún使用Http client
Arduino Yún使用Http client
Arduino 習作工坊 - Lesson 2 動力之夜
Arduino 習作工坊 - Lesson 2 動力之夜
Unity遊戲程式設計(04) 2D運動與碰撞處理I
Unity遊戲程式設計(04) 2D運動與碰撞處理I
Arduino AMA中級認證術科實作 all
Arduino AMA中級認證術科實作 all
Unity遊戲程式設計(01) Unity簡介
Unity遊戲程式設計(01) Unity簡介
Unity遊戲程式設計(09) 3D物件與光源設定
Unity遊戲程式設計(09) 3D物件與光源設定
mBot 教學7 聲光控制應用
mBot 教學7 聲光控制應用
Mbot教學(1b) mBot初體驗
Mbot教學(1b) mBot初體驗
mBot 教學5 超音波感測應用
mBot 教學5 超音波感測應用
mBot 教學6 光感測器與LED應用
mBot 教學6 光感測器與LED應用
Arduino、Web 到 IoT
Arduino、Web 到 IoT
Introduction to Arduino Programming
Introduction to Arduino Programming
Similaire à Arduino Yun 物聯網 Lesson 3
Monitouch Express Vol08
Monitouch Express Vol08
monitouch
20120613 - Hardware knowledge which the software engineer must understand
20120613 - Hardware knowledge which the software engineer must understand
Jethro Yeh
Deployment instruction tg3100 ig-cn
Deployment instruction tg3100 ig-cn
ahnlabchina
Deployment instruction tg1100 ig-cn
Deployment instruction tg1100 ig-cn
ahnlabchina
LabView with Lego NXT
LabView with Lego NXT
CAVEDU Education
2024 SIMPLIS 系列課程 _ SIMPLIS電路模擬軟體的基礎操作教學
2024 SIMPLIS 系列課程 _ SIMPLIS電路模擬軟體的基礎操作教學
ssuser29f076
Deployment instruction tg4100 f-ig_cn
Deployment instruction tg4100 f-ig_cn
ahnlabchina
Ch08
Ch08
jashliao
11, OCP - awr & alert system
11, OCP - awr & alert system
ted-xu
Raspberry Pi 智能風扇
Raspberry Pi 智能風扇
艾鍗科技
18 cpu02
18 cpu02
Huaijin Chen
使用 Pytest 進行單元測試 (PyCon TW 2021)
使用 Pytest 進行單元測試 (PyCon TW 2021)
Max Lai
電力監控IOT
電力監控IOT
Felix Lin
2014暑期訓練之Linux kernel power
2014暑期訓練之Linux kernel power
冠宇 陳
6, workflow miscellaneous
6, workflow miscellaneous
ted-xu
Monitouch Express Vol19
Monitouch Express Vol19
monitouch
使用 Controller
使用 Controller
Shengyou Fan
Electrical parameter measurement
Electrical parameter measurement
chuancao
3.檔案內容簡介
3.檔案內容簡介
Hong Da Lin
Cch2v6
Cch2v6
WeiXiang Wang
Similaire à Arduino Yun 物聯網 Lesson 3
(20)
Monitouch Express Vol08
Monitouch Express Vol08
20120613 - Hardware knowledge which the software engineer must understand
20120613 - Hardware knowledge which the software engineer must understand
Deployment instruction tg3100 ig-cn
Deployment instruction tg3100 ig-cn
Deployment instruction tg1100 ig-cn
Deployment instruction tg1100 ig-cn
LabView with Lego NXT
LabView with Lego NXT
2024 SIMPLIS 系列課程 _ SIMPLIS電路模擬軟體的基礎操作教學
2024 SIMPLIS 系列課程 _ SIMPLIS電路模擬軟體的基礎操作教學
Deployment instruction tg4100 f-ig_cn
Deployment instruction tg4100 f-ig_cn
Ch08
Ch08
11, OCP - awr & alert system
11, OCP - awr & alert system
Raspberry Pi 智能風扇
Raspberry Pi 智能風扇
18 cpu02
18 cpu02
使用 Pytest 進行單元測試 (PyCon TW 2021)
使用 Pytest 進行單元測試 (PyCon TW 2021)
電力監控IOT
電力監控IOT
2014暑期訓練之Linux kernel power
2014暑期訓練之Linux kernel power
6, workflow miscellaneous
6, workflow miscellaneous
Monitouch Express Vol19
Monitouch Express Vol19
使用 Controller
使用 Controller
Electrical parameter measurement
Electrical parameter measurement
3.檔案內容簡介
3.檔案內容簡介
Cch2v6
Cch2v6
Plus de CAVEDU Education
Google TPU Edge SBC_190424
Google TPU Edge SBC_190424
CAVEDU Education
From computational Thinking to computational Action - Dr. Hal Abelson, MIT Ap...
From computational Thinking to computational Action - Dr. Hal Abelson, MIT Ap...
CAVEDU Education
180321 MIT見聞分享
180321 MIT見聞分享
CAVEDU Education
BBC Micro:bit beginner project
BBC Micro:bit beginner project
CAVEDU Education
LINE Messaging API with LinkIt 7697
LINE Messaging API with LinkIt 7697
CAVEDU Education
Latte panda workshop_japan
Latte panda workshop_japan
CAVEDU Education
拿鐵熊貓外殼設計0707
拿鐵熊貓外殼設計0707
CAVEDU Education
LinkIt 7697 outer case - DesignSpark Mechanical / Onkscape
LinkIt 7697 outer case - DesignSpark Mechanical / Onkscape
CAVEDU Education
170615 國中小自造者教育師資培訓營
170615 國中小自造者教育師資培訓營
CAVEDU Education
170522_Raspberry Pi 相容開發板
170522_Raspberry Pi 相容開發板
CAVEDU Education
Maker Movement and Education in Taiwan
Maker Movement and Education in Taiwan
CAVEDU Education
161123
161123
CAVEDU Education
IBM以雲端技術與物聯網創新產業應用@2016 New Taipei Maker Faire
IBM以雲端技術與物聯網創新產業應用@2016 New Taipei Maker Faire
CAVEDU Education
AAEON 當創客碰上UP板 - Intel Cherry Trail 高效能maker開發者平台@2016 new taipei maker faire
AAEON 當創客碰上UP板 - Intel Cherry Trail 高效能maker開發者平台@2016 new taipei maker faire
CAVEDU Education
物聯網好棒棒 您專屬的IoT私有雲平台
物聯網好棒棒 您專屬的IoT私有雲平台
CAVEDU Education
絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座Final
絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座Final
CAVEDU Education
LinkIt ONE tutorial #2- Communication and cloud service
LinkIt ONE tutorial #2- Communication and cloud service
CAVEDU Education
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
CAVEDU Education
160625 arduino101
160625 arduino101
CAVEDU Education
2016 CAVEDU物聯網應用發表會 - 開場
2016 CAVEDU物聯網應用發表會 - 開場
CAVEDU Education
Plus de CAVEDU Education
(20)
Google TPU Edge SBC_190424
Google TPU Edge SBC_190424
From computational Thinking to computational Action - Dr. Hal Abelson, MIT Ap...
From computational Thinking to computational Action - Dr. Hal Abelson, MIT Ap...
180321 MIT見聞分享
180321 MIT見聞分享
BBC Micro:bit beginner project
BBC Micro:bit beginner project
LINE Messaging API with LinkIt 7697
LINE Messaging API with LinkIt 7697
Latte panda workshop_japan
Latte panda workshop_japan
拿鐵熊貓外殼設計0707
拿鐵熊貓外殼設計0707
LinkIt 7697 outer case - DesignSpark Mechanical / Onkscape
LinkIt 7697 outer case - DesignSpark Mechanical / Onkscape
170615 國中小自造者教育師資培訓營
170615 國中小自造者教育師資培訓營
170522_Raspberry Pi 相容開發板
170522_Raspberry Pi 相容開發板
Maker Movement and Education in Taiwan
Maker Movement and Education in Taiwan
161123
161123
IBM以雲端技術與物聯網創新產業應用@2016 New Taipei Maker Faire
IBM以雲端技術與物聯網創新產業應用@2016 New Taipei Maker Faire
AAEON 當創客碰上UP板 - Intel Cherry Trail 高效能maker開發者平台@2016 new taipei maker faire
AAEON 當創客碰上UP板 - Intel Cherry Trail 高效能maker開發者平台@2016 new taipei maker faire
物聯網好棒棒 您專屬的IoT私有雲平台
物聯網好棒棒 您專屬的IoT私有雲平台
絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座Final
絕地武士心靈控制家用雲端智慧型物聯網光劍搭載無線路由器光劍底座Final
LinkIt ONE tutorial #2- Communication and cloud service
LinkIt ONE tutorial #2- Communication and cloud service
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
160901 翻轉開發,活用雲端創新技術@IBM Cloud Innovation Day
160625 arduino101
160625 arduino101
2016 CAVEDU物聯網應用發表會 - 開場
2016 CAVEDU物聯網應用發表會 - 開場
Arduino Yun 物聯網 Lesson 3
1.
Arduino Yun物聯網應用 Lesson 3 RestfulAPI
控制繼電器 Web 介面 發布 Facebook 動態
2.
本日進度 • Arduino Yún
接上繼電器,並透過Yún REST API來使用網路瀏覽器遙控此繼電器。 • 使用類比電流感測器來測接接在繼電器的 設備電力消耗量,並計算電力即時消耗量。 • 將此資料傳送至Google Docs試算表以方便 從任何瀏覽器或是手機應用程式來遠端存 取。 • 製作簡易網路介面以方便使用電腦、智慧 型手機或平板來遙控檯燈。
3.
範例列表 • EX_1:sensor_test – 透過網路瀏覽器下指令來控制繼電器開關。 –
顯示感測器值於 Serial Monitor • EX_2:energy_log – 等待網路指令來開關繼電器。 – 將資料定期發送到Google Docs 試算表。 • EX_3:webinterface – 使用網路介面來遙控(電腦或手機皆可)
4.
專題1 [遠距耗能監控裝置]
5.
所需硬體 • Arduino Yun •
類比電流感測器 Arduino A0 • 繼電器模組 Arduino D8 • 公/母電線接頭
6.
繼電器 • 繼電器是一個電磁開 關,當我們需要用小 電壓(Arduino開發 板的5V)的指令訊 號來開關相當大的電 壓(110V或230V) 時便會派上用場。 • 訊號Arduino
D8, GNDArduino GND
7.
類比電流感測器 • 是由印刷電路板、晶片本體與其 它元件(電阻和電容等)組成。 • 這個感測器會輸出與測得電流量 成正比的類比訊號。 •
訊號Arduino A0, GNDArduino GND
8.
接線完成 繼電器為HIGH時,電路接通 電流感測器與電線串聯
9.
REST API • 請到Arduino
Yun 的設定頁面最下方,把 REST API ACCESS 改為 OPEN。 • 不然會一直要您輸入密碼,而且沒反應… • 由 sketch 中的 void process(YunClient client) 來處理 API call。
10.
如果發生這種狀況 • 請把 Line35
的 server.listenOnLocalhost(); 註解掉
11.
測試 D13 with
LED • <網址>/arduino/digital/腳位/1 or 0
12.
讀取數位腳位狀態
13.
也可以類比寫入 • <網址>/arduino/analog/腳位/0~255
14.
讀取類比腳位狀態 • A0 腳位對應的編號為14 •
http://playground.arduino.cc/Learning/Pins
15.
設定數位腳位狀態 • <網址>/arduino/mode/input 或
output
16.
EX_1 網路控制繼電器與抓感測器值 / sensor_test 透過網路瀏覽器下指令來控制繼電器 開關。 還可把感測器值顯示於
Serial Monitor
17.
修改電壓 230
110 (V) • float effective_voltage = 230;
18.
getSensorValue()函式 移動平均(取100筆) for (int i
= 0; i < nb_measurements; i++) { sensorValue = analogRead(CURRENT_SENSOR); avgSensor = avgSensor + float(sensorValue); } avgSensor = avgSensor/float(nb_measurements); return avgSensor //回傳計算結果
19.
功率量測:Line59 • // Perform
power measurement • float sensor_value = getSensorValue(); • Serial.print("Sensor value: "); • Serial.println(sensor_value);
20.
轉換為電流:Line64 • // Convert
to current • amplitude_current =(float)(sensor_value- zero_sensor)/1024*5/185*1000000; • effective_value=amplitude_current/1.414; //電流振幅÷根號2即為有效電流
21.
轉換為有效功率:Line74 • abs(effective_value*effective_voltage/1000) • 功率
= 電流 * 電壓 // P = IV
22.
開始測試 • 確認您的Yun與電腦都在同一個無線網路 • 在瀏覽器輸入
xx.local/arduino/digital/8/1 • 透過REST API來呼叫digitalWrite(8,HIGH) 指 令。您應該馬上會聽見繼電器切換的聲音, 並看見燈光亮起。 • 請用 …/8/0 來關閉檯燈
23.
檢視電流量測值 • 把Arduino Yun
用 USB 接回電腦 • 在Serial Monitor 中檢 查以下數值
24.
EX_2 傳送資料到Google Doc /energy_log 等待網路指令來開或關上繼電器; 將資料依固定時間區間傳送到Google Docs
試算表,方便追蹤能量消耗值。
25.
建立Google Docs試算表 • 試算表名稱任意,本範例為
Power (Line42) • 欄位: Time、Interval、Power和Energy
26.
公式說明 • Energy =
Power x Time • 能量 = 功率 x 時間 • 在此其實要用到積分,但我們改用梯形公 式來近似即可。 • Energy= (PowerMeasurement + NextPowerMeasurement)*TimeInverval/2 • D2 = (B2 + B3)*C2/2
27.
申請Temboo帳號 https://www.temboo.com/
28.
註冊流程 • 在主頁面中,請輸入您的電子郵件地址來 註冊並點選 Sign
up。 • 建立您的第一個應用程式。請記錄以下資 料:應用程式的名稱,還有系統指派給您 的金鑰;本書之後都會用到它們。
29.
ACCOUNT/新增一個 Application • 建立您的第一個應用程式。請記錄以下資 料:應用程式的名稱,還有系統指派給您 的金鑰;本書之後都會用到它們。
30.
ACTIVITY/流量監控畫面
31.
Temboo Choreo 物件 •
用來與指定web service 互動,本範例為 Google Docs • 另外也可用於 Gmail、Twitter等
32.
在程式中加入Google account • Line40 •
const String GOOGLE_USERNAME = "yourGoogleUsername"; • const String GOOGLE_PASSWORD = "yourGooglePass"; • const String SPREADSHEET_TITLE = "Power";
33.
在TembooAccount.h中修改 • #define TEMBOO_ACCOUNT "temboo_accout_name" //Temboo
帳號名稱 • #define TEMBOO_APP_KEY_NAME " temboo_app_name " //Temboo app 名稱 • #define TEMBOO_APP_KEY " temboo_api_key " //Temboo app 金鑰
34.
檢查是否該量測電流了 • if (power_measurement_cycles
> power_measurement_cycles_max) • float sensor_value = getSensorValue();
35.
計算 • // 轉換為電流 •
amplitude_current=(float)(sensor_value- zero_sensor)/1024*5/185*1000000; • effective_value=amplitude_current/1.414; • // 計算功率 • float effective_power = abs(effective_value * effective_voltage/1000);
36.
傳送資料,計數器歸零 • runAppendRow(measurements_interval,effect ive_power); • power_measurement_cycles
= 0;
37.
組合資料並送出 • // Format
data – L149 • String data = ""; • data = data + timeString + "," + String(measurements_interval) + "," + String(effectiveValue); • // Set Choreo inputs • AppendRowChoreo.addInput("RowData", data); • // Run the Choreo • unsigned int returnCode = AppendRowChoreo.run();
38.
檢查Google Docs 有沒有資料進來
39.
EX_3 使用網路介面來遙控 /webinterface Arduino 程式沿用
EX_2
40.
網路介面包含了那些東西 • Interface.html • jquery-2.0.3.min.js •
script.js • style.css • update_state.php
41.
interface.html • <script src="jquery-2.0.3.min.js"></script> •
<script src="script.js"></script> • <link rel="stylesheet" type="text/css" href="style.css"> //匯入 JS 函式庫與css樣式檔 • <input type="button" id="on" class="commandButton" value="On" • onClick=“relayOn()”/> //按下ON按鈕呼叫 relayOn() 函式
42.
style.css 中定義版面配置與顏色等 body { font-family:
Helvetica; } #relay { text-align: center; } .commandButton { background-color: orange; border: 1px solid black; font-size: 40px; cursor: pointer; border-radius: 10px; width: 300px; height: 100px; } @media screen and (max-device-width: 400px) { .commandButton { width: 100%; height: 200px; border: 2px solid black; font-size: 80px; margin-bottom: 50px; text-align: center; background-color: orange; } }
43.
JavaScript 用來溝通 html
與 php • function relayOn(){ • $.get( "update_state.php", { command: "1"} ); • }
44.
update_state.php 中則是實際動作 <?php // Create
cURL call, make sure to change it with your Yun name $service_url = 'http://myarduinoyun.local/arduino/digital/8/' . $_G $curl = curl_init($service_url); // Send cURL to Yun board curl_setopt($curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE $curl_response = curl_exec($curl); //執行 curl_close($curl); ?>
45.
自行架設php server • 安裝
Appserv 之後,把 webinterface 資料夾 中所有檔案都放到 C:AppServwww 中 • 在 cmd 中使用 ipconfig 指令查找本機 IP,這 樣才可以用手機等外部裝置連入。 • 在瀏覽器中輸入 http://localhost/index.php 可看到預設畫面
46.
AppServ 預設畫面
47.
操作 • 打開瀏覽器,輸入您的電腦IP或網路名稱, 應該會看見專案中的各檔案顯示出來。 • http://localhost/interface.html •
http://YourIP/interface.html
48.
手機端操作 • 如果是智慧型手機,則介 面會自動調整螢幕大小
49.
Facebook 發布動態 Temboo 連結
Facebook app
50.
Temboo 網站左側的 Facebook •
Facebook / Publishing/SetStatus
51.
目標:先取得 OAuth Tokens
再取得 AccessToken
52.
0. 記得開 IoT
Mode / Arduino Yun • Arduino + 網路擴充板 • Arduino Yun • 德儀 LaunchPad
53.
1. 先在Facebook Developer建立一個app
54.
2. 設定FB app
的 Callback URL
55.
在Settings 下設定完成
56.
3. 填入App ID
與 App Secret
57.
4. 啟動認證 –
同意外部連結
58.
5. 取得 AccessToken
59.
6. 輸入AccessToken 與
Message
60.
畫面下方會自動產生Arduino code
61.
發布完成!
62.
參考資料 • RESTAPI – http://android.serverbox.ch/?p=1039 –
https://learn.adafruit.com/a-rest-api-for-arduino-and-the- cc3000-wifi-chip/overview – http://yehnan.blogspot.tw/2014/04/arduino- yunbridgeyunserveryunclient.html • PHP – http://blog.xuite.net/arcloveangel/lovestore/22930165- Appserv%E6%9E%B6%E7%AB%99%E6%95%99%E5%AD%B8- %E5%AE%8C%E6%95%B4%E5%AE%89%E8%A3%9D%E8%A8%A D%E5%AE%9A%E6%8C%87%E5%8D%97 – http://mark528.pixnet.net/blog/post/7267604- %E5%9C%A8windows%E5%AE%89%E8%A3%9Dphp%E9%96%8 B%E7%99%BC%E7%92%B0%E5%A2%83
Notes de l'éditeur
Center 88888887
我們使用HTML來製作控制開關按鈕的主頁面;JavaScript則負責這個按鈕的動作;以及用PHP將正確的指令傳送到Arduino伺服器。我們還會使用一些CSS來讓介面看起來更棒,同時也讓它能自動根據您使用的裝置來自我調整,例如智慧型手機。
Télécharger maintenant