Top Banner
2013.10.05 GDG Hyderabad DevFest
18

GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

May 12, 2015

Download

Self Improvement

Anwaarullah

This is the slides that were used to demo the concept of using the Chrome Serial API with an Arduino (Integrating Chrome with Embedded Systems) at the Google Developer Group Hyderabad DevFest, 5th Oct, 2013.

The source code is available at:

https://bitbucket.org/anwaarullah/chromearduino
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

2013.10.05 GDG Hyderabad DevFest

Page 2: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

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

Agenda

• Introduction

• Demo

• Implementation

• Q&A

3

Page 4: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

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

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

What is…

No. Slide

Page 7: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

IoT…

No. Slide

Page 8: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

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

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

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

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

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

Demo…

12

Demo

Page 14: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

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

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

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

Q&A

16

Page 18: GDG Dev Fest - Hyderabad - Using Chrome Serial API with Arduino

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…