100% found this document useful (2 votes)
115 views

PDF JavaScript on Things: Hacking hardware for web developers Lyza Danger Gardner download

Gardner

Uploaded by

groomnabda21
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
115 views

PDF JavaScript on Things: Hacking hardware for web developers Lyza Danger Gardner download

Gardner

Uploaded by

groomnabda21
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

JavaScript on Things: Hacking hardware for web


developers Lyza Danger Gardner

https://textbookfull.com/product/javascript-on-things-
hacking-hardware-for-web-developers-lyza-danger-gardner/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Ethereum for Web Developers: Learn to Build Web


Applications on top of the Ethereum Blockchain Santiago
Palladino
https://textbookfull.com/product/ethereum-for-web-developers-learn-to-
build-web-applications-on-top-of-the-ethereum-blockchain-santiago-
palladino/
textboxfull.com

JavaScript Frameworks for Modern Web Dev 1st Edition


Ambler Tim

https://textbookfull.com/product/javascript-frameworks-for-modern-web-
dev-1st-edition-ambler-tim/

textboxfull.com

Understanding ECMAScript 6 The definitive guide for


Javascript developers 1st Edition Nicholas C. Zakas

https://textbookfull.com/product/understanding-ecmascript-6-the-
definitive-guide-for-javascript-developers-1st-edition-nicholas-c-
zakas/
textboxfull.com

Web Security for Developers Real Threats Practical Defense


1st Edition Malcolm Mcdonald

https://textbookfull.com/product/web-security-for-developers-real-
threats-practical-defense-1st-edition-malcolm-mcdonald/

textboxfull.com
Web Security for Developers Real Threats Practical Defense
1st Edition Malcolm Mcdonald

https://textbookfull.com/product/web-security-for-developers-real-
threats-practical-defense-1st-edition-malcolm-mcdonald-2/

textboxfull.com

Hands On Hacking Matthew Hickey

https://textbookfull.com/product/hands-on-hacking-matthew-hickey/

textboxfull.com

JavaScript Cookbook: Programming the Web 3rd Edition Scott

https://textbookfull.com/product/javascript-cookbook-programming-the-
web-3rd-edition-scott/

textboxfull.com

Visual Studio Code: End-to-End Editing and Debugging Tools


for Web Developers Bruce Johnson

https://textbookfull.com/product/visual-studio-code-end-to-end-
editing-and-debugging-tools-for-web-developers-bruce-johnson/

textboxfull.com

Azure DevOps for Web Developers: Streamlined Application


Development Using Azure DevOps Features Ambily K K

https://textbookfull.com/product/azure-devops-for-web-developers-
streamlined-application-development-using-azure-devops-features-
ambily-k-k/
textboxfull.com
WOW! eBook
www.wowebook.org
For online information and ordering of this and other Manning books, please visit
Topics
www.manning.com. The publisher offers discounts on this book when ordered in
quantity. For more information, please contact
Tutorials

Special Sales Department


Offers & Deals Manning Publications Co.
20 Baldwin Road
PO Box 761
Highlights
Shelter Island, NY 11964
Email: orders@manning.com
Settings

©2018 by Manning Publications Co. All rights reserved.


Support

No part of this publication may be reproduced, stored in a retrieval system, or


Sign Out
transmitted, in any form or by means electronic, mechanical, photocopying, or
otherwise, without prior written permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their


products are claimed as trademarks. Where those designations appear in the book, and
Manning Publications was aware of a trademark claim, the designations have been
printed in initial caps or all caps.

Recognizing the importance of preserving what has been written, it is Manning’s


policy to have the books we publish printed on acid­free paper, and we exert our best
efforts to that end. Recognizing also our responsibility to conserve the resources of our
planet, Manning books are printed on paper that is at least 15 percent recycled and
processed without the use of elemental chlorine.

WOW! eBook
www.wowebook.org
Developmental editor: Susanna Kline
Review editor: Ivan Martinovic
Project editor: Kevin Sullivan
Copyeditor: Andy Carroll
Proofreader: Melody Dolab
Typesetter: Gordan Salinovic
Cover designer: Leslie Haimes
Cover and interior illustrations: Lyza Danger Gardner

ISBN 9781617293863

Printed in the United States of America

1 2 3 4 5 6 7 8 9 10 – EBM – 23 22 21 20 19 18

WOW! eBook
www.wowebook.org
Playlists

Brief Table of Contents


History

Copyright
Topics

Brief Table of Contents


Tutorials
Table of Contents
Offers & Deals
Preface
Highlights
Acknowledgments

Settings
About this Book

Support
1. A JavaScripter’s introduction to hardware

Sign Out
Chapter 1. Bringing JavaScript and hardware together

Chapter 2. Embarking on hardware with Arduino

Chapter 3. How to build circuits

2. Project basics: input and output with Johnny­Five

Chapter 4. Sensors and input

Chapter 5. Output: making things happen

Chapter 6. Output: making things move

3. More sophisticated projects

Chapter 7. Serial communication

Chapter 9. Building your own thing


WOW! eBook
www.wowebook.org
4. Using JavaScript with hardware in other environments

Chapter 10. JavaScript and constrained hardware

Chapter 11. Building with Node.js and tiny computers

Chapter 12. In the cloud, in the browser, and beyond

Index

List of Figures

List of Tables

List of Listings

WOW! eBook
www.wowebook.org
Playlists

Table of Contents
History

Copyright
Topics

Brief Table of Contents


utorials
Table of Contents
ffers & Deals
Preface
ghlights
Acknowledgments

ettings
About this Book

Support
1. A JavaScripter’s introduction to hardware

Sign Out
Chapter 1. Bringing JavaScript and hardware together

1.1. The anatomy of hardware projects

1.1.1. Inputs and outputs

1.1.2. Processing

1.1.3. Power, circuits, and systems

1.1.4. Logic and firmware

1.1.5. Enclosures and packaging

1.1.6. Embedded systems

1.2. How JavaScript and hardware work together

1.2.2. Embedded JavaScript


WOW! eBook
www.wowebook.org
1.2.3. Other hardware­JavaScript combinations

1.3. Is JavaScript a good fit for hardware?

1.4. Putting together a hardware toolkit

1.4.1. Development boards

1.4.2. Input and output components

1.4.3. Other electronic components

1.4.4. Power, wires, and accessories

1.4.5. Tools

Summary

Chapter 2. Embarking on hardware with Arduino

2.1. Getting to know the Arduino Uno

2.1.1. Creating your first circuit with an Arduino Uno

2.2. Working with the Arduino workflow

2.2.1. Arduino Uno’s digital pins

2.2.2. Sketches and the Arduino IDE

2.2.3. Connecting the LED to a digital pin

2.2.4. Programming the LED to blink

2.3. Controlling the Arduino with JavaScript

2.3.1. Configuring the Arduino as a client

2.3.2. Installing the Johnny­Five Node.js framework

2.3.3. Hello World blinking LED with Johnny­Five

2.3.4. Firmata, Johnny­Five, and the host­client method

WOW! eBook
www.wowebook.org
2.3.5. Structuring scripts with Johnny­Five

Summary

Chapter 3. How to build circuits

3.1. Voltage, current, and resistance

3.1.1. Ohm’s law

3.1.2. Problems and dangers

3.2. Building circuits

3.2.1. Using breadboards to prototype circuits

3.2.2. Wiring a simple LED circuit on a breadboard

3.2.3. Expanding a series circuit with a button

3.2.4. LEDs in series

3.2.5. Parallel circuits and current dividers

3.2.6. Powering your project with batteries

Summary

2. Project basics: input and output with Johnny­Five

Chapter 4. Sensors and input

4.1. Working with analog sensors

4.1.1. Analog­to­digital conversion

4.1.2. Working with photoresistors

4.1.3. Voltage dividers

4.1.4. Wiring and using a photoresistor

4.1.5. Using an analog temperature sensor

WOW! eBook
www.wowebook.org
4.2. Digital inputs

4.2.1. Using a button as a digital input

Summary

Chapter 5. Output: making things happen

5.1. Lighting things up

5.1.1. Fading LEDs with pulse­width modulation (PWM)

5.1.2. Animating LEDs with PWM

5.1.3. Combining input with LED output

5.1.4. Going full­color with RGB LEDs

5.1.5. Build your own “weather ball”

5.2. Working with parallel LCD displays

5.2.1. Making a full­featured timer with LCD

5.2.2. Adding a visual LED “chime”

5.3. Making noise with a piezo

5.3.1. Adding an audible piezo chime to the timer

Summary

Chapter 6. Output: making things move

6.1. Making motors spin

6.1.1. How motors work

6.1.2. Controlling a motor with a push­button switch

6.1.3. Controlling a motor with Johnny­Five

6.2. Making servos go

WOW! eBook
www.wowebook.org
6.2.1. Controlling a servo with Johnny­Five

6.3. Building your first robot!

6.3.1. Robots and motors

6.3.2. Building the robot’s chassis base

6.3.3. Controlling the robot’s motors

Summary

3. More sophisticated projects

Chapter 7. Serial communication

7.1. Communicating digital data in parallel and in serial

7.2. The basics of serial communication

7.3. Asynchronous serial communication

7.3.1. UARTs

7.3.2. Trying out software serial with a GPS breakout board

7.3.3. Learn to solder!

7.3.4. Building the GPS circuit

7.4. Synchronous serial communication

7.4.1. Serial Peripheral Interface (SPI)

7.4.2. I2C

7.4.3. Making a digital compass with an I2C magnetometer

7.5. Pulling it together: shake­to­change multisensor widget

7.5.1. Step 1: combining a compass with LCD output

7.5.2. Step 2: adding a multisensor to the device

WOW! eBook
www.wowebook.org
7.5.3. Step 3: updating the display to show temperature and pressure

7.5.4. Step 4: adding a shake­to­swap display feature with an accelerometer

Summary

Chapter 8. Projects without wires

8.1. Why you’ve been tethered so far

8.1.1. Data exchange, the I/O layer, and I/O plugins

8.1.2. USB as a power source

8.1.3. Options for wires­free project communication

8.2. Toward wires­free projects using the Tessel 2

8.3. Getting your Tessel set up

8.3.1. Configuring the Tessel

8.3.2. “Hello World” LED blinking on the Tessel

8.3.3. Blinking an external LED with the Tessel

8.3.4. Exploring the Tessel’s pins and capabilities

8.4. Projects without wires on the Tessel

8.4.1. Wires­free data: a remote weather station

8.5. Powering projects with batteries

8.5.1. A battery­powered robot with the Tessel

Summary

Chapter 9. Building your own thing

9.1. Hacking consumer electronics

9.1.1. Modifying RF­controlled outlet switches

WOW! eBook
www.wowebook.org
9.2. Controlling the remote switches with a Johnny­Five component plugin

9.2.1. Prototyping the switch project

9.2.2. Writing the RemoteSwitch plugin

9.3. Writing software for sophisticated hardware

9.3.1. Project: Johnny­Five support for APDS­9660 gesture sensor

9.3.2. Implementing constructor and initialization methods

9.3.3. Integrating the gesture sensor and remote switches

9.3.4. Pulling the whole project together

Summary

4. Using JavaScript with hardware in other environments

Chapter 10. JavaScript and constrained hardware

10.1. The Espruino Pico platform

10.1.1. Setting up the Pico

10.1.2. Hello World LED blink

10.2. Learning about new platforms

10.2.1. Discovering a platform’s core features

10.2.2. Finding a pinout diagram

10.2.3. Learning about configuration and workflow

10.2.4. Finding examples and tutorials

10.2.5. Using reference API documentation

10.3. Experimenting with the Pico

10.3.1. The Pico and the BMP180 multisensor

WOW! eBook
www.wowebook.org
10.3.2. The Pico and the Nokia 5110 LCD

10.3.3. Building a power­efficient weather gadget with the Pico

10.4. Experimenting with the Kinoma Element platform

10.4.1. The Element’s core features

10.4.2. Pinout and hardware diagram

10.4.3. Configuration, management, workflow

10.4.4. Examples and tutorials

10.4.5. API reference

10.4.6. Case­study project: live­updating compass readings

Summary

Chapter 11. Building with Node.js and tiny computers

11.1. Working with tiny computers

11.1.1. The Raspberry Pi platform

11.1.2. Configuration option 1: the traditional way

11.1.3. Configuration option 2: headless

11.2. Learning about the Raspberry Pi 3

11.2.1. Core features

11.2.2. GPIO features and pinouts

11.2.3. Configuration and workflow

11.2.4. Examples and tutorials

11.2.5. API documentation

11.3. Writing Johnny­Five applications for different platforms

WOW! eBook
www.wowebook.org
11.3.1. Adapting the mini weather station for the Pi 3

11.3.2. Adapting the mini weather station for the Arduino Uno

11.4. Using the Raspberry Pi as a host

11.5. Case study: BeagleBone Black

11.5.1. Learning about the BeagleBone Black

11.5.2. Adapting the weather station for the BeagleBone

Summary

Chapter 12. In the cloud, in the browser, and beyond

12.1. IoT and the cloud

12.2. Containerized deployment with resin.io

12.2.1. Creating a resin.io application

12.2.2. Provisioning the BeagleBone Black

12.2.3. Adapting the weather application software

12.3. Hardware and the web browser

12.3.1. The Web Bluetooth API

12.3.2. The Generic Sensor API

12.3.3. The Physical Web

12.4. Exploring Bluetooth LE with Puck.js

12.4.1. Core features

12.4.2. GPIO features and pinouts

12.4.3. Configuration and workflow

12.4.4. Examples, tutorials, and API documentation

WOW! eBook
www.wowebook.org
12.4.5. Controlling the LED from a web page

12.4.6. The Physical Web and Puck.js

12.4.7. A web­based Bluetooth doorbell

12.5. Pushing the frontiers of JavaScript and hardware

Summary

Index

List of Figures

List of Tables

List of Listings

WOW! eBook
www.wowebook.org
Preface
History

On a late summer day in 2013, I stood on a stage in a large tent on the grounds of
Topics
Bletchley Park in England, the site where British codebreakers (famously including
Alan Turing) defeated the Enigma machine in World War II. It was one of the better
Tutorials
days of my life, as two fundamentally wonderful things had just happened.

Offers & Deals


First, I’d just somehow managed to win a hacking contest (that’s why I was onstage).
The National Museum of Computing—also located on the grounds of Bletchley Park—
Highlights
was seeking tech help in creating web­based, interactive timeline exhibits. I’d stayed up
through the night, extending an open source JavaScript library and building a
Settings
prototype: this was my entry, which was, to my great delight, declared best in show. The
second wonderful thing was that I’d won a prize—and not just any prize.
Support

The reward I received was one of the original Arduino Uno starter kits—an Arduino
Sign Out
board, a collection of electronic components, and an instructional book. It profoundly
changed my life. I’d later find that combining my newly learned electronics skills with
the stuff I did every day—coding open source, standards­based websites and apps—
resulted in one of the most fascinating alchemies I’d ever experienced: JavaScript on
Things. That is, I could use the JavaScript I already knew as a turbo boost to electronics
hacking and the internet of things (IoT).

That came later, however. Initially, I learned how to construct simple electronic circuits
by working through the examples in the kit’s book and, later, avidly searching the web
to learn more. I learned how to apply logical control to these circuits by programming
the Arduino Uno’s microcontroller, writing simple sketches (programs) in Arduino’s
(very) C/C++­like language, optimized for the board’s (very) limited program space and
memory.

And then, at the end of 2013, I discovered Johnny­Five. The open source Node.js
framework was young at the time, but already powerful. Instead of writing lower­level,
,
constrained Arduino .
code, I could write higher­level JavaScript. programs to control my
.
Uno. I thought, “Wow, if I’d only discovered this earlier.”

WOW! eBook
www.wowebook.org
The combination of JavaScript and microcontrollers isn’t just a parlor trick, performed
for the sake of coating the entire known world with JavaScript. At first, even I, a
Node.js adherent, was skeptical: maybe this is pointless; maybe it will never take root.

Don’t worry. It’s not, and it did.

Adding JavaScript into the mix perversely simplified my experience, and made
prototyping little projects much, much faster. I could use development workflows that
were more familiar to me as a web developer. I didn’t have to concern myself as much
with lower­level memory and resource optimization. Johnny­Five’s encapsulation of
behavior into high­level component classes is intuitive: the resulting code can be
cleaner and easier to work with than many Arduino libraries. And it allowed me to take
advantage of the almost fathomless depths of the worldwide Node.js ecosystem via
npm. I could simply import modules, just like any other Node.js script out there. It was
wonderful.

I want to be very clear: there’s nothing wrong with Arduino or more “traditional” C­
based microcontroller programming. There are very good reasons to care about
memory management, for example, especially if you’re writing firmware or making
production devices. And Arduino is rather a miracle: its entire raison d’être is to make
embedded electronics accessible to novices. Starting from scratch with Arduino and the
Arduino programming language is a perfectly reasonable, surmountable approach.

But JavaScript can help web developers get up to speed with electronics faster. For one
thing, introductory materials for Arduino (and other platforms) often assume no pre­
existing knowledge of programming whatsoever, which means you may end up wading
through explanations of what an array is and how loops work. The finicky constraints
and particulars of microcontrollers can be distracting when you’re just learning how
things work. IDEs can be clunky. In some cases, you can end up spending a lot of time
getting things configured and not much time making things actually happen. JavaScript
has the power to abstract much of this away, letting you focus on the essential new
things you need to learn.

From that notion, this book arose: the idea that JavaScript can serve as a gateway to
electronics, making it easier for more people to learn how to make cool stuff with a
minimum of cognitive pain. JavaScript is the most popular programming language in
the world, the de facto language of the web; and the internet of things and maker
culture is tantalizing both creatively and commercially. Why not make a happy blend of
the two?

WOW! eBook
www.wowebook.org
At the end of the day, this stuff is fun. It’s a kick to be able to dream up and make real
your own inventions. It’s confidence­lifting to have a basic competency with low­
voltage electronic circuits, and to understand how embedded systems work in the real
world.

Maybe you’ll really love this like I do. Maybe you’ll help contribute to open source
projects. Maybe you’ll construct a wildly clever gadget. Maybe you’ll teach other people
what you’ve learned.

Perhaps you’ll simply have fun. That, on its own, is more than enough.

WOW! eBook
www.wowebook.org
Playlists

Acknowledgments
History

My gratitude starts right where my love of hardware hacking began: with the Over the
Topics
Air conference crew and The National Museum of Computing (UK), whence my initial
Arduino Starter Kit originated. None of this would have happened without that
Tutorials
serendipitous event. Dan Appelquist, Margaret Gold, and Matthew Cashmore—thank
you for creating such a superb conference and inviting me to it, more than once, even!
Offers & Deals

Rick Waldron achieves more in a day than I do in a month. (Rick, your JavaScript
Highlights
genius is legend.) His involvement with TC­39, the ECMA working group responsible
for the JavaScript language itself, means he is literally indispensable. Oh, and he also
Settings
invented Johnny­Five, the leading open source Node.js framework for robotics and IoT,
around which much of this book revolves. I could go on for pages, chapters, about Rick.
Support

Writing a book takes a ridiculously large amount of time. Huge thanks go to leaders and
Sign Out
colleagues at Bocoup for giving me the time and support I needed, and for continuously
pumping steady amounts of enthusiasm in my direction, as well as to the partners and
staff at Cloud Four for their patience.

Great editors are a true gift in a world that sometimes dismisses the value of editorial
process and feedback. My editor, Susanna Kline, provided helpful and insightful
support through the long haul. Brad Luyster, your technical review feedback was
phenomenal; it’s hard to say thank you hard enough. Several other reviewers also
provided helpful feedback on the manuscript at different stages: Alessandro Campeis,
Amit Lamba, Andrew Meredith, Bruno Sonnino, Earl Bingham, and Kevin Liao. I also
want to thank Manning’s publisher, Marjan Bace, and the rest of the editorial and
production teams who worked on the book behind the scenes.

Thanks also to Francis Gulotta for technical input, Kyle Jackson at Manning for fielding
my tech support needs, and my pal Chau Doan for sharing his firmware and embedded­
electronics wisdom.

.
The Johnny­Five and related JavaScript­on­Things communities have been just
brilliant. Thanks, Derek Runberg of SparkFun! Thanks, Donovan Buck, David
WOW! eBook
www.wowebook.org
Resseguie, Brian Genisio, and all the other Johnny­Five contributors!

Shawn Hymel’s Arduino library for the APDS­9960 sensor—a handsome piece of work
—served as a springboard for parts of chapter 9. And the rover examples in chapters 6 and

8 are adapted from code written by Rick Waldron. (Again, Rick, thanks!)

Equally important to those who help you on a project itself are those who help you keep
your sanity while enduring it: thank you, my splendid family and friends.

I saved this extra­best spot right here to thank my partner (and all­round fantastic
person) Bryan Fox: without his joyful and steady presence, this book could not possibly
exist.

WOW! eBook
www.wowebook.org
Playlists

About this Book


History

“I’m curious about hardware and electronics and IoT, but I have absolutely no idea
Topics
where to begin.” I’ve heard that notion, in many variations, from many (dozens?—at
least—maybe a hundred?) web developers. Yes, it certainly would be fun to be able to
Tutorials
build robots and clever gadgets. Yes, it would be useful to know how to read data from
sensors and do interesting things with the data, to be able to construct your own
Offers & Deals
automated, web­connected devices (for feeding your pet on time, detecting rainfall
amounts, displaying the latest rugby scores—the mind really does boggle at all the
Highlights
possibilities). But also, yes, it can feel like a daunting, even overwhelming, new
landscape if you’ve never so much as made an LED blink, much less written and flashed
Settings
optimized firmware to an embedded microcontroller.

Support
Good news! You can take advantage of your understanding of JavaScript and general
programming metaphors to frame your learning adventure, and make wrapping your
Sign Out
head around this new world a bit less chaotic. JavaScript can lend a sheen of
familiarity, providing a touchstone to ease your introduction to electronics, hardware,
and the internet of things (IoT).

This book teaches the fundamentals of electronics and embedded systems for folks who
are comfortable with basic JavaScript but who may have no experience whatsoever
wiring up even the simplest circuit. Emphasis is put on the topics that will be new to
software developers: the critical basics of designing and building circuits, hardware
components (sensors, motors, resistors, and the like), and the interface between
hardware and software.

Over the course of this book, you’ll get hands­on with a variety of development boards,
hardware components, and software platforms. For the experiments (small projects) in
the first two­thirds of the book, we’ll use the Johnny­Five open source Node.js
framework with the Arduino Uno development board. Johnny­Five’s API provides
many intuitive component classes that you can use to quickly prototype your gadgets
and inventions. The Uno is the most ubiquitous hobbyist board in the world, boasting
stability, simplicity, reliability, and a huge community of users and educators. The last
third of the book surveys a broader range of platforms, including the Node.js­capable
WOW! eBook
www.wowebook.org
Tessel 2 and the very popular Raspberry Pi.

By the end of the book, you should have a foundational toolkit—both mental and
physical—for planning, designing, implementing, and extending your own JavaScript­
controlled electronic creations.

ROADMAP
The book consists of 12 chapters:

Chapter 1 defines what embedded systems are and enumerates the physical
components from which they’re built. It explains the ways in which JavaScript and
hardware can work together.

Chapter 2 introduces the Arduino Uno development board and gets you hands­on,
quickly, with some basic blinking LEDs. We’ll briefly look at how to control the Uno
with the Arduino IDE before jumping into JavaScript and Johnny­Five.

Chapter 3 zooms way in on the fundamentals of electronics that serve as the


foundation for all the circuits you’ll ever build. You’ll plumb the depths of Ohm’s
law and build a few different kinds of simple circuits.

Chapters 4 through 6 are a romp through key electronics and concepts for

embedded gadgets, exploring input (sensors), output (actuators), and physical


movement (motors and servos). Using the Johnny­Five framework, you’ll get a
chance to build a bunch of different experiments with an Arduino Uno board.

Chapter 7 examines serial communication, which is used for exchanging more


sophisticated data. You’ll try out several serial components, including a compass
(magnetometer), an accelerometer, and a GPS, again using Johnny­Five and the
Arduino Uno.

Chapters 8 and 9 introduce the Node.js­capable Tessel 2 development board. In


chapter 8, you’ll learn how to make projects that aren’t tethered by wires. In chapter 9,
you’ll explore the process of taking an original project from idea to inception.

Chapters 10 and 11 delve into other I/O­capable embedded hardware and JavaScript.
Chapter 10 looks at JavaScript and JavaScript­like environments on constrained
platforms like the Espruino Pico. Chapter 11 explores more general­purpose single­
board computers (SBCs) like the Raspberry Pi.

Chapter 12 touches on cloud services and hardware control from the browser, and it
looks to the future. You’ll learn how to use a cloud service, resin.io, to manage and
WOW! eBook
www.wowebook.org
deploy a Johnny­Five application to a BeagleBone Black, and you’ll build an in­
browser wireless doorbell with the Puck.js device and the Web Bluetooth API.

WHO SHOULD READ THIS BOOK?


This is a book for people who have some experience with JavaScript, but who know
little or nothing about electronic circuitry and microcontroller programming.

Code examples in this book are not, for the most part, complex. My philosophy is that
it’s better for code to be readable and understandable than for it to be show­offy and
clever. You certainly don’t need to have a deep familiarity with every word in the
ECMA­262 spec (that’s the document that defines the JavaScript language); but if you
feel faint at the sight of arrow functions or haven’t yet gotten to know Promises, for
example, you may want to brush up a bit or keep a friendly companion at your side,
such as the very excellent Secrets of the JavaScript Ninja, Second Edition, by John
Resig, Bear Bibeault, and Josip Maras (Manning, 2016; www.manning.com/books/secrets­
of­the­javascript­ninja­second­edition). Code complexity and the use of modern language
features increase toward the end of the book.

Although the step­by­step instructions for the experiments provide all the commands
you’ll need to make your creations go, you should have basic competency in installing,
managing, and using Node.js and the npm package manager. You should also be
comfortable with executing commands from within a terminal environment.

A working knowledge of HTML and general grasp of CSS is helpful, although not
essential. (You could always cut and paste source markup for those components.)
Chapter 12 involves the use of Git version control software—prior experience with Git is
helpful but not critical.

CODE CONVENTIONS AND DOWNLOADS


This book includes copious examples, which include various resources needed for
applications and experiments: JavaScript, HTML, CSS, JSON, and so on. Source code
in listings, or in text, is in a fixed­width font to separate it from ordinary text.
Additionally, method or class names, variable names, object properties, method
parameters, HTML elements, and the like, in text are also presented using a fixed­width
font.

Johnny­Five is open source, released under the (liberal) MIT software license. The book
makes use of many other open source software projects, including a dozen or so third­
party npm modules. Most of the hardware platforms explored are open source as well;
WOW! eBook
www.wowebook.org
an exception is the Raspberry Pi 3, covered in chapter 11. To complete the “weather ball”
example in chapter 5, you’ll need a (free) API key from Dark Sky
(https://darksky.net/dev/register).

Code annotations accompany many of the source code listings, highlighting important
concepts.

The source code and assets for all examples in this book are available at
https://github.com/lyzadanger/javascript­on­things. Most examples in the book include all
the needed code and markup in the text (source code for third­party modules isn’t
included). But you can find the complete source of a few longer examples toward the
end of the book, as well as binary assets for examples (such as the MP3 used in the web­
controlled doorbell in chapter 12), in the code repository.

A zip file containing source code at the time of publication will also be available on the
publisher’s website: www.manning.com/books/javascript­on­things.

BOOK FORUM
Purchase of JavaScript on Things includes free access to a private web forum run by
Manning Publications where you can make comments about the book, ask technical
questions, and receive help from the author and from other users. To access the forum,
go to https://forums.manning.com/forums/javascript­on­things. You can also learn more
about Manning’s forums and the rules of conduct at
https://forums.manning.com/forums/about.

Manning’s commitment to our readers is to provide a venue where a meaningful


dialogue between individual readers and between readers and the author can take
place. It is not a commitment to any specific amount of participation on the part of the
author, whose contribution to the forum remains voluntary (and unpaid). We suggest
you try asking the author some challenging questions lest her interest stray! The forum
and the archives of previous discussions will be accessible from the publisher’s website
as long as the book is in print.

ABOUT THE AUTHOR


Lyza Danger Gardner likes figuring out how to do things. In turn, she likes to teach
others how to do new things, too. Lyza cofounded Cloud Four, a web consultancy in
Portland, Oregon. She’s been building web things for over 20 years, advocating for
elegant standards, education, and compassion in pursuit of the best possible future
web. You can find her online at www.lyza.com or @lyzadanger on Twitter. As a
WOW! eBook
www.wowebook.org
counterpoint to her futuristic technical vantage, she lives in the forest in Vermont and
enjoys anachronistic hobbies. She reads and reads and reads.

WOW! eBook
www.wowebook.org
Part 1. A JavaScripter’s introduction to hardware
History

This part of the book will introduce you to the fundamentals of embedded systems and
Topics
electronic circuits. In chapter 1, you’ll learn what embedded systems are and how to
analyze their constituent components. We’ll spend some time looking at what it means
Tutorials
for JavaScript to “control” hardware, and we’ll examine the different ways that
JavaScript and electronics can work together.
Offers & Deals

You’ll meet the Arduino Uno R3 development board in chapter 2, which we’ll use with all
Highlights
of the experiments through chapter 7. You’ll learn what the main parts of development
boards do and how they interact with other software and hardware components. You’ll
Settings
try out some basic LED experiments with the Uno using both the Arduino IDE and the
Johnny­Five Node.js framework.
Support

Chapter 3 will teach you the key fundamentals of electronic circuitry, diving into Ohm’s
Sign Out
law and the relationships between voltage, current, and resistance. You’ll work on a
breadboard, constructing series and parallel circuits that contain multiple LEDs.

When you’re finished with this part of the book, you’ll have grasp of the basic
embedded­system underpinnings and core circuit concepts. You’ll be ready to start
building small, JavaScript­controlled projects with different kinds of inputs and
outputs.

WOW! eBook
www.wowebook.org
Playlists

Chapter 1. Bringing JavaScript and hardware together


History

This chapter covers


Topics
Components and hardware involved in hobbyist projects and the “internet of
Tutorialsthings”

Common components of embedded systems


Offers & Deals
Different methods for using JavaScript with embedded systems
Highlights
Tools and supplies you’ll need to start building

Settings
As a JavaScript­savvy web developer, you make logical alchemy happen every day. But
now it’s possible to wield your software­development skills in a new way, to program
Support
and control things in the real world. In this chapter, you’ll learn about the hardware
involved in different kinds of projects and devices, and you’ll also see how JavaScript
Sign Out
and hardware can work together.

We’re surrounded by little magical things that blend the physical world with the realm
of the logical, connected, and virtual (figure 1.1). A keychain that broadcasts its location
wirelessly so you can find it with an app on your smartphone. A plant pot that makes
whining noises when it needs to be watered, or, better yet, sends you a petulant text
message. Billions of such objects blink, beep, tweet, automatically dim the lights, make
customized pots of tea, and otherwise perform their specialized duties across the
planet.

Figure 1.1. Oh, the magical things in our world!

WOW! eBook
www.wowebook.org
It’s fun to build this stuff. The creativity involved when crafting with these kinds of
physical gadgets, the grassroots charm of inventive homebrew projects—these are the
kinds of things that hold appeal for web developers. We’re cut out for prototyping,
experimenting with new technologies, and blazing our own trails.

But getting started can be intimidating. When we see all the wires and components,
hear the jargon, stand on the outside looking in at hardware­hacking communities, the
kinds of skills involved can feel formidable, foreign. As a JavaScript developer, you may
be faced with some hurdles—perceived complexity, overabundant and scattered
information, conflation of hardware and software concepts—as you make your tentative
first forays into the world of physical hardware.

We’re going to use your JavaScript know­how as an advantage, an aid to learning how
to design and build the kinds of things that make up the “internet of things” (IoT) and
inspire hardware hackers. You’ll be able to use your software­development skills to skip
past some distractions and get focused, quickly, on the new skills you need to learn.

To get a feel for the journey we’re taking, let’s first take a look at the kinds of things
you’ll be learning to build. Let’s explore what we mean, exactly, when we say things or
hardware.

1.1. THE ANATOMY OF HARDWARE PROJECTS


We could build a little gadget that would automatically turn a fan on when it gets warm.
This miniature, independent climate­control device would continuously monitor the
temperature of the surrounding environment. When it gets too hot, the fan comes on.
When it’s nice and cool again, the fan turns off.

While we wouldn’t win any prestigious awards for the invention of this admittedly
WOW! eBook
www.wowebook.org
pedestrian contrivance, its basic ingredients are common to the other—more inspiring
—things you’ll learn to build.

1.1.1. Inputs and outputs


The most important thing—really the only thing—our temperature­triggered device
needs to do is turn a fan on when it’s too toasty and turn it back off again when the area
around it has cooled off. The motor­driven fan is an example of an output device.

To get continuous information about the temperature of the immediate environment—


so that the device can make decisions about when to turn the fan on or off—we need
data from an input, in this case a temperature sensor (figure 1.2).

Figure 1.2. The automatic fan system needs to take input from a temperature
sensor and manage the output of a motorized fan.

Inputs provide incoming data to the system, and sensors are a type of input that
provides data about the physical environment. There are all kinds of sensors you can
use in projects: sensors for light, heat, noise, vibration, vapors, humidity, smells,
motion, flames—you name it. Some, like our fan’s temperature sensor, provide simple
data—just a single value representing temperature—whereas others, like GPS or
accelerometers, produce more elaborate data.

A project’s outputs represent its net functionality to someone using it. Blinking lights,
irritating beeping sounds, status readouts on LCD screens, a robotic arm moving
sideways—all these are kinds of outputs. For this project, the fan is the sole output.

Not all inputs and outputs necessarily manifest in the physical world. A customer
WOW! eBook
www.wowebook.org
Exploring the Variety of Random
Documents with Different Content
My good Lord Sinnatus,
I once was at the hunting of a lion.
Roused by the clamour of the chase he woke,
Came to the front of the wood—his monarch mane
Bristled about his quick ears—he stood there
Staring upon the hunter. A score of dogs
Gnaw’d at his ankles: at the last he felt
The trouble of his feet, put forth one paw,
Slew four, and knew it not, and so remain’d
Staring upon the hunter: and this Rome
Will crush you if you wrestle with her; then
Save for some slight report in her own Senate
Scarce know what she has done.
(Aside.) Would I could move him,
Provoke him any way! (Aloud.) The Lady Camma,
Wise I am sure as she is beautiful,
Will close with me that to submit at once
Is better than a wholly-hopeless war,
Our gallant citizens murder’d all in vain,
Son, husband, brother gash’d to death in vain,
And the small state more cruelly trampled on
Than had she never moved.

Camma.

Sir, I had once


A boy who died a babe; but were he living
And grown to man and Sinnatus will’d it, I
Would set him in the front rank of the fight
With scarce a pang. (Rises.) Sir, if a state submit
At once, she may be blotted out at once
And swallow’d in the conqueror’s chronicle.
Whereas in wars of freedom and defence
The glory and grief of battle won or lost
Solders a race together—yea—tho’ they fail,
The names of those who fought and fell are like
A bank’d-up fire that flashes out again
From century to century, and at last
May lead them on to victory—I hope so—
Like phantoms of the Gods.

Sinnatus.

Well spoken, wife.

Synorix (bowing).

Madam, so well I yield.

Sinnatus.

I should not wonder


If Synorix, who has dwelt three years in Rome
And wrought his worst against his native land,
Returns with this Antonius.

Synorix.

What is Synorix?

Sinnatus.

Galatian, and not know? This Synorix


Was Tetrarch here, and tyrant also—did
Dishonour to our wives.

Synorix.

Perhaps you judge him


With feeble charity: being as you tell me
Tetrarch, there might be willing wives enough
To feel dishonour, honour.

Camma.

Do not say so.


I know of no such wives in all Galatia.
There may be courtesans for aught I know
Whose life is one dishonour.

Enter Attendant.

Attendant (aside).

My lord, the men!

Sinnatus (aside).

Our anti-Roman faction?

Attendant (aside).

Ay, my lord.

Synorix (overhearing).

(Aside.) I have enough—their anti-Roman faction.

Sinnatus (aloud).

Some friends of mine would speak with me without.


You, Strato, make good cheer till I return.

[Exit.

Synorix.

I have much to say, no time to say it in.


First, lady, know myself am that Galatian
Who sent the cup.

Camma.

I thank you from my heart.


Synorix.

Then that I serve with Rome to serve Galatia.


That is my secret: keep it, or you sell me
To torment and to death.

[Coming closer.

For your ear only—


I love you—for your love to the great Goddess.
The Romans sent me here a spy upon you,
To draw you and your husband to your doom.
I’d sooner die than do it.

[Takes out paper given him by


Antonius.

This paper sign’d


Antonius—will you take it, read it? there!

Camma.

(Reads) “You are to seize on Sinnatus,—if——”

Synorix.

(Snatches paper.) No more.


What follows is for no wife’s eyes. O Camma,
Rome has a glimpse of this conspiracy;
Rome never yet hath spar’d conspirator.
Horrible! flaying, scourging, crucifying——

Camma.

I am tender enough. Why do you practise on me?

Synorix.

Why should I practise on you? How you wrong me!


I am sure of being every way malign’d.
And if you should betray me to your husband——

Camma.

Will you betray him by this order?

Synorix.

See,
I tear it all to pieces, never dream’d
Of acting on it.

[Tears the paper.

Camma.

I owe you thanks for ever.

Synorix.

Hath Sinnatus never told you of this plot?

Camma.

What plot?

Synorix.

A child’s sand-castle on the beach


For the next wave—all seen,—all calculated,
All known by Rome. No chance for Sinnatus.

Camma.

Why, said you not as much to my brave Sinnatus?

Synorix.
Brave—ay—too brave, too over-confident,
Too like to ruin himself, and you, and me!
Who else, with this black thunderbolt of Rome
Above him, would have chased the stag to-day
In the full face of all the Roman camp?
A miracle that they let him home again,
Not caught, maim’d, blinded him.

[Camma shudders.

(Aside.) I have made her tremble.


(Aloud.) I know they mean to torture him to death.
I dare not tell him how I came to know it;
I durst not trust him with—my serving Rome
To serve Galatia: you heard him on the letter.
Not say as much? I all but said as much.
I am sure I told him that his plot was folly.
I say it to you—you are wiser—Rome knows all,
But you know not the savagery of Rome.

Camma.

O—have you power with Rome? use it for him!

Synorix.

Alas! I have no such power with Rome. All that


Lies with Antonius.

[As if struck by a sudden thought.


Comes over to her.

He will pass to-morrow


In the gray dawn before the Temple doors.
You have beauty,—O great beauty,—and Antonius,
So gracious toward women, never yet
Flung back a woman’s prayer. Plead to him,
I am sure you will prevail.
Camma.

Still—I should tell


My husband.

Synorix.

Will he let you plead for him


To a Roman?

Camma.

I fear not.

Synorix.

Then do not tell him.


Or tell him, if you will, when you return,
When you have charm’d our general into mercy,
And all is safe again. O dearest lady,

[Murmurs of “Synorix! Synorix!” heard


outside.

Think,—torture,—death,—and come.

Camma.

I will, I will.
And I will not betray you.

Synorix (aside).

(As Sinnatus enters.) Stand apart.

Enter Sinnatus and Attendant.

Sinnatus.
Thou art that Synorix! One whom thou hast wrong’d
Without there, knew thee with Antonius.
They howl for thee, to rend thee head from limb.

Synorix.

I am much malign’d. I thought to serve Galatia.

Sinnatus.

Serve thyself first, villain! They shall not harm


My guest within my house. There! (points to door) there! this
door
Opens upon the forest! Out, begone!
Henceforth I am thy mortal enemy.

Synorix.

However I thank thee (draws his sword); thou hast saved my


life.

[Exit.

Sinnatus.

(To Attendant.) Return and tell them Synorix is not here.

[Exit Attendant.

What did that villain Synorix say to you?

Camma.

Is he—that—Synorix?

Sinnatus.

Wherefore should you doubt it?


One of the men there knew him.
Camma.

Only one,
And he perhaps mistaken in the face.

Sinnatus.

Come, come, could he deny it? What did he say?

Camma.

What should he say?

Sinnatus.

What should he say, my wife!


He should say this, that being Tetrarch once
His own true people cast him from their doors
Like a base coin.

Camma.

Not kindly to them?

Sinnatus.

Kindly?
O the most kindly Prince in all the world!
Would clap his honest citizens on the back,
Bandy their own rude jests with them, be curious
About the welfare of their babes, their wives,
O ay—their wives—their wives. What should he say?
He should say nothing to my wife if I
Were by to throttle him! He steep’d himself
In all the lust of Rome. How should you guess
What manner of beast it is?

Camma.
Yet he seem’d kindly,
And said he loathed the cruelties that Rome
Wrought on her vassals.

Sinnatus.

Did he, honest man?

Camma.

And you, that seldom brook the stranger here,


Have let him hunt the stag with you to-day.

Sinnatus.

I warrant you now, he said he struck the stag.

Camma.

Why no, he never touch’d upon the stag.

Sinnatus.

Why so I said, my arrow. Well, to sleep.

[Goes to close door.

Camma.

Nay, close not yet the door upon a night


That looks half day.

Sinnatus.

True; and my friends may spy him


And slay him as he runs.

Camma.
He is gone already.
Oh look,—yon grove upon the mountain,—white
In the sweet moon as with a lovelier snow!
But what a blotch of blackness underneath!
Sinnatus, you remember—yea, you must,
That there three years ago—the vast vine-bowers
Ran to the summit of the trees, and dropt
Their streamers earthward, which a breeze of May
Took ever and anon, and open’d out
The purple zone of hill and heaven; there
You told your love; and like the swaying vines—
Yea,—with our eyes,—our hearts, our prophet hopes
Let in the happy distance, and that all
But cloudless heaven which we have found together
In our three married years! You kiss’d me there
For the first time. Sinnatus, kiss me now.

Sinnatus.

First kiss. (Kisses her.) There then. You talk almost as if it


Might be the last.

Camma.

Will you not eat a little?

Sinnatus.

No, no, we found a goat-herd’s hut and shared


His fruits and milk. Liar! You will believe
Now that he never struck the stag—a brave one
Which you shall see to-morrow.

Camma.

I rise to-morrow
In the gray dawn, and take this holy cup
To lodge it in the shrine of Artemis.
Sinnatus.

Good!

Camma.

If I be not back in half an hour,


Come after me.

Sinnatus.

What! is there danger?

Camma.

Nay,
None that I know: ’tis but a step from here
To the Temple.

Sinnatus.

All my brain is full of sleep.


Wake me before you go, I’ll after you—
After me now!

[Closes door and exit.

Camma (drawing curtains).

Your shadow. Synorix—


His face was not malignant, and he said
That men malign’d him. Shall I go? Shall I go?
Death, torture—
“He never yet flung back a woman’s prayer”—
I go, but I will have my dagger with me.

[Exit.

Scene III.—Same as Scene I. Dawn.


Music and Singing in the Temple.

Enter Synorix watchfully, after him Publius and Soldiers.

Synorix.

Publius!

Publius.

Here!

Synorix.

Do you remember what


I told you?

Publius.

When you cry “Rome, Rome,” to seize


On whomsoever may be talking with you,
Or man, or woman, as traitors unto Rome.

Synorix.

Right. Back again. How many of you are there?

Publius.

Some half a score.

[Exeunt Soldiers and Publius.

Synorix.

I have my guard about me.


I need not fear the crowd that hunted me
Across the woods, last night. I hardly gain’d
The camp at midnight. Will she come to me
Now that she knows me Synorix? Not if Sinnatus
Has told her all the truth about me. Well,
I cannot help the mould that I was cast in.
I fling all that upon my fate, my star.
I know that I am genial, I would be
Happy, and make all others happy so
They did not thwart me. Nay, she will not come.
Yet if she be a true and loving wife
She may, perchance, to save this husband. Ay!
See, see, my white bird stepping toward the snare.
Why now I count it all but miracle,
That this brave heart of mine should shake me so,
As helplessly as some unbearded boy’s
When first he meets his maiden in a bower.

Enter Camma (with cup).

Synorix.

The lark first takes the sunlight on his wing,


But you, twin sister of the morning star,
Forelead the sun.

Camma.

Where is Antonius?

Synorix.

Not here as yet. You are too early for him.

[She crosses towards Temple.

Synorix.

Nay, whither go you now?

Camma.
To lodge this cup
Within the holy shrine of Artemis,
And so return.

Synorix.

To find Antonius here.

[She goes into the Temple, he looks


after her.

The loveliest life that ever drew the light


From heaven to brood upon her, and enrich
Earth with her shadow! I trust she will return.
These Romans dare not violate the Temple.
No, I must lure my game into the camp.
A woman I could live and die for. What!
Die for a woman, what new faith is this?
I am not mad, not sick, not old enough
To doat on one alone. Yes, mad for her,
Camma the stately, Camma the great-hearted,
So mad, I fear some strange and evil chance
Coming upon me, for by the Gods I seem
Strange to myself.

Re-enter Camma.

Camma.

Where is Antonius?

Synorix.

Where? As I said before, you are still too early.

Camma.

Too early to be here alone with thee;


For whether men malign thy name, or no,
It bears an evil savour among women.
Where is Antonius? (Loud.)

Synorix.

Madam, as you know


The camp is half a league without the city;
If you will walk with me we needs must meet
Antonius coming, or at least shall find him
There in the camp.

Camma.

No, not one step with thee.


Where is Antonius? (Louder.)

Synorix (advancing towards her).

Then for your own sake,


Lady, I say it with all gentleness,
And for the sake of Sinnatus your husband,
I must compel you.

Camma (drawing her dagger).

Stay!—too near is death.

Synorix (disarming her).

Is it not easy to disarm a woman?

Enter Sinnatus (seizes him from behind by the throat).

Synorix (throttled and scarce audible).

Rome! Rome!

Sinnatus.
Adulterous dog!

Synorix (stabbing him with Camma’s dagger).

What! will you have it?

[Camma utters a cry and runs to


Sinnatus.

Sinnatus (falls backward).

I have it in my heart—to the Temple—fly—


For my sake—or they seize on thee. Remember!
Away—farewell!

[Dies.

Camma (runs up the steps into the Temple, looking back).

Farewell!

Synorix (seeing her escape).

The women of the Temple drag her in.


Publius! Publius! No,
Antonius would not suffer me to break
Into the sanctuary. She hath escaped.

[Looking down at Sinnatus.

“Adulterous dog!” that red-faced rage at me!


Then with one quick short stab—eternal peace.
So end all passions. Then what use in passions?
To warm the cold bounds of our dying life
And, lest we freeze in mortal apathy,
Employ us, heat us, quicken us, help us, keep us
From seeing all too near that urn, those ashes
Which all must be. Well used, they serve us well.
I heard a saying in Egypt, that ambition
Is like the sea wave, which the more you drink,
The more you thirst—yea—drink too much, as men
Have done on rafts of wreck—it drives you mad.
I will be no such wreck, am no such gamester
As, having won the stake, would dare the chance
Of double, or losing all. The Roman Senate,
For I have always play’d into their hands,
Means me the crown. And Camma for my bride—
The people love her—if I win her love,
They too will cleave to me, as one with her.
There then I rest, Rome’s tributary king.

[Looking down on Sinnatus.

Why did I strike him?—having proof enough


Against the man, I surely should have left
That stroke to Rome. He saved my life too. Did he?
It seem’d so. I have play’d the sudden fool.
And that sets her against me—for the moment.
Camma—well, well, I never found the woman
I could not force or wheedle to my will.
She will be glad at last to wear my crown.
And I will make Galatia prosperous too,
And we will chirp among our vines, and smile
At bygone things till that (pointing to Sinnatus) eternal peace.
Rome! Rome!

Enter Publius and Soldiers.

Twice I cried Rome. Why came ye not before?

Publius.

Why come we now? Whom shall we seize upon?

Synorix (pointing to the body of Sinnatus).

The body of that dead traitor Sinnatus.


Bear him away.

Music and Singing in Temple.

END OF ACT I.
ACT II.
Scene.—Interior of the Temple of Artemis.

Small gold gates on platform in front of the veil before the colossal
statue of the Goddess, and in the centre of the Temple a tripod
altar, on which is a lighted lamp. Lamps (lighted) suspended
between each pillar. Tripods, vases, garlands of flowers, etc.,
about stage. Altar at back close to Goddess, with two cups.
Solemn music. Priestesses decorating the Temple.

Enter a Priestess.

Priestess.

Phœbe, that man from Synorix, who has been


So oft to see the Priestess, waits once more
Before the Temple.

Phœbe.

We will let her know.

[Signs to one of the Priestesses, who


goes out.

Since Camma fled from Synorix to our Temple,


And for her beauty, stateliness, and power,
Was chosen Priestess here, have you not mark’d
Her eyes were ever on the marble floor?
To-day they are fixt and bright—they look straight out.
Hath she made up her mind to marry him?

Priestess.

To marry him who stabb’d her Sinnatus.


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like