Arduino 2nd Uide Book
Arduino 2nd Uide Book
Instead of using a microphone and speakers, you can also use a PING))) sensor. With
the lessons you’ve learned in this chapter, you can build such a system yourself with
ease. Try it!
a. http://blog.makezine.com/2009/10/15/using-sonar-to-save-power/
It defines all meta information needed, and it declares that the Chrome App
needs to access the serial port. The background.js file isn’t 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 }
});
});
To create the dashboard’s 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 (●)
for a filled circle. Each <span> element gets a unique ID, so we can refer to
the individual LEDs later on.