EasyManuals Logo

Arduino Pro Mini User Manual

Arduino Pro Mini
311 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #112 background imageLoading...
Page #112 background image
It defines all meta information needed, and it declares that the Chrome App
needs to access the serial port. The
background.js
file isnt very exciting, either:
InputDevices/Dashboard/background.js
chrome.app.runtime.onLaunched.addListener(function() {
chrome.app.window.create('main.html', {
id: 'main',
bounds: { width: 600, height: 300 }
});
});
It opens a new window and displays the
main.html
file:
InputDevices/Dashboard/main.html
<!DOCTYPE html>
Line 1
<html lang="en">
-
<head>
-
<meta charset="utf-8"/>
-
<link rel="stylesheet" type="text/css" href="css/dashboard.css"/>
5
<title>Dashboard Demo</title>
-
</head>
-
<body>
-
<div id="dashboard">
-
<div id="distance-display">
10
<p>
-
<span id="d1">&#x25cf;</span>
-
<span id="d2">&#x25cf;</span>
-
<span id="d3">&#x25cf;</span>
-
<span id="d4">&#x25cf;</span>
15
<span id="d5">&#x25cf;</span>
-
<span id="d6">&#x25cf;</span>
-
<span id="d7">&#x25cf;</span>
-
<span id="d8">&#x25cf;</span>
-
</p>
20
</div>
-
<div id="temperature-display">
-
<p><span id="temperature"></span> &#x2103;</p>
-
</div>
-
</div>
25
<script src="js/serial_device.js"></script>
-
<script src="js/dashboard.js"></script>
-
</body>
-
</html>
-
To create the dashboards user interface, we need only some basic HTML. We
define the whole parking-distance control display in lines 12 to 19. We repre-
sent each LED by a
<span>
element containing the Unicode character (&#x25cf)
for a filled circle. Each
<span>
element gets a unique ID, so we can refer to
the individual LEDs later on.
Chapter 5. Sensing the World Around Us 94
report erratum discuss
www.it-ebooks.info

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Arduino Pro Mini and is the answer not in the manual?

Arduino Pro Mini Specifications

General IconGeneral
BrandArduino
ModelPro Mini
CategoryMotherboard
LanguageEnglish

Related product manuals