SlideShare une entreprise Scribd logo
1  sur  49
Télécharger pour lire hors ligne
Arduino 開發板
Arduino 豐富的元件和傳感器
Arduino 開發工具
從Web開發角度
思考Arduino
v
c
如果每個傳感器都是一個
HTML標籤 …
<led state='on'>
</led>
點亮LED燈
馬達轉90度
<motor rotate='90'>
</motor>
<arduino>
<led state='on'>
</arduino>
乾脆Arduino也是HTML標籤
使用Arduino
從來沒有如此簡單過...
插電就 IoT !!!
用HTML/JS 控制 Arduino
比較項目 Arduino Webduino
開發語言 C / C++ HTML / JavaScript
開發環境 Arduino IDE 瀏覽器 / ...
連接方式 USB WiFi
更新程式 連接燒錄 立即更新
直接用 HTML控制 LED
<wa-led id='led' pin='10' state='off'>
</wa-led>
直接用 HTML控制 LED
<wa-led id='led' pin='10' state='on'>
</wa-led>
直接用 JS控制按鈕
var btn = document.getElementById('button');
btn.on('pressed', function() {
//dosomething...
});
輕鬆整合既有網頁遊戲
多人同時即時互動
通過最嚴酷的網路環境 - 高鐵
Webduino = WebComponents + Arduino
用 HTML/JS 控制 Arduino,玩轉 IoT
http://webcomponents.org/ http://arduino.cchttp://fb.me/webduino
Internet
小威須透過
WiFi分享器上網
Internet
或透過手機分享
WiFi上網
如何連線?
1. 用WebComponent 整合 Breakout
2. 用WebSocket (Firmata) 和後端Server交互
3. 後端Server走TCP/IP (Firmata) 控制 Webduino
Internet
Internet
Browser
Code
CodeRuntime
Runtime
Code
運行環境
Browser
Code
Runtime
Code
控制Webduino的HTML寫法
<web-arduino device="????">
</web-arduino>
Web Components - 組裝元件
<web-arduino device="????">
<wa-led pin='10'></wa-led>
</web-arduino>
<web-arduino device="????">
<wa-ultrasonic trig="11" echo="10">
</wa-ultrasonic>
</web-arduino>
Web Components - 組裝元件
<html>
<head>
//Web Components http://webcomponents.org/
<script src="http://webduino.io/components/webcomponentsjs/webcomponents.js">
</script>
//Arduino板子
<link rel='import' href='http://webduino.io/components/webduino/web-arduino.html'>
</link>
.
.
.
</head>
HTML需引入js、arduino元件
// 按鈕
<link rel='import' href='http://webduino.io/components/webduino/wa-button.html'></link>
// LED
<link rel='import' href='http://webduino.io/components/webduino/wa-led.html'></link>
// 3色全彩LED
<link rel='import' href='http://webduino.io/components/webduino/wa-rgbled.html'></link>
// 伺服馬達元件
<link rel='import' href='http://webduino.io/components/webduino/wa-servo.html'></link>
// 超音波元件
<link rel='import' href='http://webduino.io/components/webduino/wa-ultrasonic.html'></link>
目前元件清單
// 人體紅外線
<link rel='import' href='http://webduino.io/components/webduino/wa-pir.html'></link>
// 水銀傾斜開關
<link rel='import' href='http://webduino.io/components/webduino/wa-mercury.html'></link>
// 振動開關
<link rel='import' href='http://webduino.io/components/webduino/wa-shock.html'></link>
// 溫濕度感測
<link rel='import' href='http://webduino.io/components/webduino/wa-dht11.html'></link>
// 步進馬達
<link rel='import' href='http://webduino.io/components/webduino/wa-stepper.html'></link>
目前元件清單
點亮 LED 燈
<html>
<head>
<script src="http://webduino.io/components/webcomponentsjs/webcomponents.js"
></script>
<link rel='import' href='http://webduino.io/components/webduino/web-arduino.
html'></link>
<link rel='import' href='http://webduino.io/components/webduino/wa-led.
html'></link>
</head>
<body>
<web-arduino id='board' device='MNW?'>
<wa-led id='led' pin='10' state='on'></wa-led>
</web-arduino>
<h1>LED On</h1>
</body>
</html>
HTML
HTML控制LED寫法
HTML Code
超音波縮放圖片
<html>
<head>
...略...
</head>
<body>
<web-arduino id='board' device='reJx'>
<wa-ultrasonic id='ultrasonic' trig='11' echo='10'>
</wa-ultrasonic>
</web-arduino>
<img id='img' src='image.jpg'></img>
</body>
</html>
window.addEventListener('WebComponentsReady', function() {
var board = document.getElementById('board');
board.on('ready', function() {
var ultrasonic = document.getElementById('ultrasonic');
var img = document.getElementById('img');
ultrasonic.ping(function(cm) {
img.style.width = cm*20 + 'px';
img.style.height = cm*20 + 'px';
}, 300);
});
}, false);
#img {
width: 200px;
transition:.3s;
}
HTML
CSS
JavaScript
超音波縮放圖片
控制伺服馬達
HTML Code
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="webduino ultrasound">
<title>UltraSound Alert</title>
<script src="http://webduino.io/components/webcomponentsjs/webcomponents.js"></script>
<link rel='import' href='http://webduino.io/components/webduino/web-arduino.
html'></link>
<link rel='import' href='http://webduino.io/components/webduino/wa-servo.html'></link>
</head>
<body>
<web-arduino id='board' device='MND0'>
<wa-servo id='servo' pin='9' angle='10'></wa-servo>
</web-arduino>
</body>
</html>
HTML
<web-arduino id='board' device='????'>
<wa-button id='button' pin='10'>
</wa-button>
</web-arduino>
用HTML宣告電路接法
更多的傳感器即將現身~
更多的有趣應用~
http://webduino.io
webduino
謝謝聆聽

Contenu connexe

En vedette

一拳前端考題
一拳前端考題一拳前端考題
一拳前端考題洧杰 廖
 
AIR QUALITY CONTROL BASED ON MICROCONTROLLER
AIR QUALITY CONTROL BASED ON MICROCONTROLLERAIR QUALITY CONTROL BASED ON MICROCONTROLLER
AIR QUALITY CONTROL BASED ON MICROCONTROLLERZikra Dinandy
 
Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Stefano Stabellini
 
Creating Great Dashboards - Beyond the Colors & Fonts
Creating Great Dashboards - Beyond the Colors & FontsCreating Great Dashboards - Beyond the Colors & Fonts
Creating Great Dashboards - Beyond the Colors & FontsLogi Analytics
 
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNOWATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNOSri Adhiyani Sunaryo
 
Automating Analysis and Exploitation of Embedded Device Firmware
Automating Analysis and Exploitation of Embedded Device FirmwareAutomating Analysis and Exploitation of Embedded Device Firmware
Automating Analysis and Exploitation of Embedded Device FirmwareMalachi Jones
 
Introducing the Civil Infrastructure Platform Project
Introducing the Civil Infrastructure Platform ProjectIntroducing the Civil Infrastructure Platform Project
Introducing the Civil Infrastructure Platform ProjectYoshitake Kobayashi
 
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air  berbasis Mik...Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air  berbasis Mik...
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...EM Kautsar
 
42629 lecture 1 pt4
42629 lecture 1 pt442629 lecture 1 pt4
42629 lecture 1 pt4Tom Howard
 
Danish ad association pres
Danish ad association presDanish ad association pres
Danish ad association presRick Webb
 
42629 lecture 1 pt3
42629 lecture 1 pt342629 lecture 1 pt3
42629 lecture 1 pt3Tom Howard
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonMalachi Jones
 
PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...
PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...
PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...Uofa_Unsada
 
42629 lecture 1 pt2
42629 lecture 1 pt242629 lecture 1 pt2
42629 lecture 1 pt2Tom Howard
 
Cassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshopCassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshoptomtobback
 
Thomas J. Howard pt.4 protovation
Thomas J. Howard pt.4   protovationThomas J. Howard pt.4   protovation
Thomas J. Howard pt.4 protovationAjujaht
 
Thomas J. Howard pt.3 open design
Thomas J. Howard pt.3   open designThomas J. Howard pt.3   open design
Thomas J. Howard pt.3 open designAjujaht
 
42629 lecture 1 pt1
42629 lecture 1 pt142629 lecture 1 pt1
42629 lecture 1 pt1Tom Howard
 

En vedette (19)

一拳前端考題
一拳前端考題一拳前端考題
一拳前端考題
 
AIR QUALITY CONTROL BASED ON MICROCONTROLLER
AIR QUALITY CONTROL BASED ON MICROCONTROLLERAIR QUALITY CONTROL BASED ON MICROCONTROLLER
AIR QUALITY CONTROL BASED ON MICROCONTROLLER
 
Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)Xen and the art of embedded virtualization (ELC 2017)
Xen and the art of embedded virtualization (ELC 2017)
 
Creating Great Dashboards - Beyond the Colors & Fonts
Creating Great Dashboards - Beyond the Colors & FontsCreating Great Dashboards - Beyond the Colors & Fonts
Creating Great Dashboards - Beyond the Colors & Fonts
 
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNOWATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
WATER LEVEL MEASURE AND CONTROL WITH ULTRASONIK SENSOR AND ARDUINO UNO
 
Automating Analysis and Exploitation of Embedded Device Firmware
Automating Analysis and Exploitation of Embedded Device FirmwareAutomating Analysis and Exploitation of Embedded Device Firmware
Automating Analysis and Exploitation of Embedded Device Firmware
 
Introducing the Civil Infrastructure Platform Project
Introducing the Civil Infrastructure Platform ProjectIntroducing the Civil Infrastructure Platform Project
Introducing the Civil Infrastructure Platform Project
 
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air  berbasis Mik...Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air  berbasis Mik...
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...
 
42629 lecture 1 pt4
42629 lecture 1 pt442629 lecture 1 pt4
42629 lecture 1 pt4
 
Danish ad association pres
Danish ad association presDanish ad association pres
Danish ad association pres
 
42629 lecture 1 pt3
42629 lecture 1 pt342629 lecture 1 pt3
42629 lecture 1 pt3
 
Offensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with PythonOffensive cyber security: Smashing the stack with Python
Offensive cyber security: Smashing the stack with Python
 
PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...
PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...
PROTOTYPE SMART HOME DENGAN KONSEP INTERNET OF THING (IOT) MENGGUNAKAN ARDUIN...
 
42629 lecture 1 pt2
42629 lecture 1 pt242629 lecture 1 pt2
42629 lecture 1 pt2
 
Cassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshopCassiopeia Ltd - ESP8266+Arduino workshop
Cassiopeia Ltd - ESP8266+Arduino workshop
 
Thomas J. Howard pt.4 protovation
Thomas J. Howard pt.4   protovationThomas J. Howard pt.4   protovation
Thomas J. Howard pt.4 protovation
 
Thomas J. Howard pt.3 open design
Thomas J. Howard pt.3   open designThomas J. Howard pt.3   open design
Thomas J. Howard pt.3 open design
 
42629 lecture 1 pt1
42629 lecture 1 pt142629 lecture 1 pt1
42629 lecture 1 pt1
 
Exercise
ExerciseExercise
Exercise
 

2015 WebConf - Web + Arduino 實在有夠潮