GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino
-
Upload
anwaarullah -
Category
Self Improvement
-
view
986 -
download
1
description
Transcript of GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino
![Page 1: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/1.jpg)
2013.10.05 GDG Hyderabad DevFest
![Page 2: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/2.jpg)
Using Chrome Serial API with Arduino
(Integrating Chrome with Embedded Systems)
2
Syed Anwaarullah
![Page 3: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/3.jpg)
Agenda
• Introduction
• Demo
• Implementation
• Q&A
3
![Page 4: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/4.jpg)
My two cents…
4
How many side does a coin have?
Software Hardware+ = ∞
![Page 5: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/5.jpg)
What is…IoT?
5
•The Internet of Things is a computing concept where everyday physical objects will be connected to the Internet
•They will also be able to identify themselves to other devices
• IoT describes a world where just about everything can be connected and communicate in an intelligent fashion
![Page 6: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/6.jpg)
What is…
No. Slide
![Page 7: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/7.jpg)
IoT…
No. Slide
![Page 8: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/8.jpg)
Where does Chrome Stop?
7
Chrome Browser is…
• _______________
• _______________
• _______________
Is that all? Should we stop here?
FastestSecureMost popular
![Page 9: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/9.jpg)
Chrome Extensions“Small Software programs that can modify and enhance the functionality of the Chrome browser”http://developer.chrome.com/extensions/index.html
• Little or No User Interface
• Essentially web pages and can use all APIs provided by browser to web pages
• User downloads and installs them
• chrome.* APIs
• Extension has:A manifest file, one or more HTML and JS files
8
![Page 10: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/10.jpg)
Chrome Packaged Apps
9
“Packaged Apps deliver an experience as capable as a native app. http://developer.chrome.com/apps/about_apps.html
• Written in HTML5, JavaScript, CSS
• Looks and behaves like a standalone web app outside the browser
• Have access to Chrome APIs and services not available to web traditional web apps like interaction with Network and Hardware devices, media tools etc
• chrome.serial API, chrome.bluetooth, chrome.usb
![Page 11: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/11.jpg)
What is Arduino?
10
“Open-source electronic prototyping platform allowing to create interactive electronic objects
• USB-Serial Interface for communicating with PC (uploading code as well)
• Arduino code based on C/C++• Thousands of libraries available
![Page 12: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/12.jpg)
Lets build an IOT device using Chrome Serial API and Arduino
11
The UML aka Circuit Diagram
![Page 13: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/13.jpg)
Demo…
12
Demo
![Page 14: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/14.jpg)
chrome.serial API
13
Use this API to read from and write to a device connected to a serial port
chrome.serial API methods
• getPorts• open• read• write• close
![Page 15: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/15.jpg)
Dissecting the Chrome App
14
Tells Chrome about the app, what it is, how to launch and permissions required
Create the event page responsible for managing app cycle
Contains UI elements; sliders, labels etc
Contains action listeners for the UI elements. Sends Serial data to Arduino using API
How to launch this app in Chrome…
![Page 16: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/16.jpg)
Dissecting the Arduino Code
15
setup() Initialization
loop() Super loop, no exit
Serial Serial Communication Library
![Page 17: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/17.jpg)
Q&A
16
![Page 18: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino](https://reader034.fdocuments.us/reader034/viewer/2022052523/5551938eb4c90580128b55bf/html5/thumbnails/18.jpg)
17
“Using Chrome Serial API with Arduino”
Thank you!
Source Code:
Syed AnwaarullahBlog: http://anwaarullah.com
Email: [email protected]: 0990-88-777-64
About Me:
• Java, GWT, MS CRM; 3+ yrs• Open Source H/W S/W
advocate• Electronics Engineer -
Education• Hardware – Software
Integrator• Android, LeapMotion,
Raspberry Pi, Robotics, AI, 3D Printing, Embedded Electronics, IoT etc…