You can use JavaScript—the language of the web—to make things happen in the real world. JavaScript controls hordes of small robots, creative maker projects, and IoT products. Inexpensive platforms like the Raspberry Pi and Tessel 2 are powerful little computers in their own right, with the oomph to run Node.js on-board, and you can also use JavaScript to control simpler boards like the ubiquitous Arduino Uno. With the Node.js ecosystem at hand, hardware prototyping gets fun, intuitive and fast. Plug stuff in—anything from motors to touch screens to soil moisture sensors—and you’re off! Let’s build something!
JavaScript on Things is your first step into the exciting—and downright entertaining—world of programming for small electronics. If you know enough JavaScript to hack a website together, you’ll be making things bleep, blink and spin faster than you can say “nodebot”. This fully-illustrated, hands-on book shows you how to get going with platforms like Arduino, Tessel, and Raspberry Pi. You’ll get a thorough crash course in basic electronics and go in-depth and step-by-step, building little projects that light up, sense the environment around you, make noise, exchange data, move around, and more. You’ll even build a wirelessly-controlled robot. Yay! Learning something truly useful has never been quite this much fun. We guarantee it.
Part 1: A JavaScripter's Introduction to Hardware
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.1. Host-Client Method
1.2.2. Embedded JavaScript
1.2.3. Other Hardware-JavaScript Combinations
1.2.4. Cloud-based Services and the Browser
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
1.5. Summary
2. Embarking on Hardware with Arduino
2.1. Getting to Know Arduino Uno
2.1.1. Creating your First Circuit with 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
2.3.5. Structuring Scripts with Johnny-Five
2.4. Summary
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
3.3. Summary
Part 2: Project Basics: Input and Output with johnnyfive
4. Sensors and Input
5. Output: Making Things Happen
6. Output: Making Things Move
Part 3: More Sophisticated Projects
7. Communicating with Serial
8. Getting Untethered: Wire-Free Projects
9. Project Software
Part 4: Using JavaScript with Hardware in Other Environments
10. Embedded JavaScript
11. Node.js and Hardware on Small Computers
12. Hardware and the Web
What's inside
- Using JavaScript in tandem with popular platforms like Arduino, Tessel 2 and Raspberry Pi
- Introduction to creating and controlling embedded projects
- Designing and assembling straightforward robots and gadgets
- Crash course in basic electronics
- Over a dozen hands-on projects
- MEAP combo $39.99 pBook + eBook
- MEAP eBook $31.99 pdf + ePub + kindle
FREE domestic shipping on three or more pBooks