Making Things Smart

Book description

Making Things Smart teaches the fundamentals of the powerful ARM microcontroller by walking beginners and experienced users alike through easily assembled projects comprised of inexpensive, hardware-store parts.

Current ARM programming books take a bland, textbook approach focused on complex, beginner-unfriendly languages like C or ARM Assembler. Making Things Smart uses Espruino (JavaScript for Hardware), flattening the learning curve.

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Conventions Used in This Book
    2. Using Code Examples
    3. O’Reilly Safari
    4. How to Contact Us
    5. Acknowledgments
  2. 1. Introduction
    1. Why Make Things Smart?
    2. Learning through Making
    3. Making in JavaScript
    4. Tools and Materials
  3. I. Microcontrollers
  4. 2. What Is a Microcontroller?
    1. ARM History
    2. Programming a Microcontroller
  5. 3. Getting Started with Espruino
    1. Getting Ready
      1. Mac and Chromebook
      2. Windows
      3. Linux (Including Raspberry Pi)
    2. Plugging In
    3. Installing Software
    4. Connecting
    5. Updating Firmware
    6. First Commands
    7. The Editor
  6. 4. Getting Started with JavaScript
    1. Getting Ready
    2. Comments
    3. Data Types
      1. Undefined
      2. Numbers
      3. Strings
      4. Booleans
    4. Math
      1. Math with Numbers
      2. Math with Strings
      3. Math with Strings and Numbers
      4. The Helpful Language
    5. Variables
    6. Increment and Decrement
    7. Objects
    8. Functions
      1. parseInt
      2. Functions in Objects (Methods)
      3. console.log
      4. Defining Functions
      5. Inline Functions
    9. Arrays
    10. Object Orientation
    11. Bitwise Arithmetic
      1. Bitwise Operators
      2. Bit Shifting
    12. If Statements
    13. && and ||
    14. Ternary Operators
    15. for Loops
    16. Exceptions
  7. II. Motors
  8. 5. What Is an Electric Motor?
    1. Experiment 1: Faraday’s Motor
    2. Experiment 2: Motor with Commutator
    3. Brushless DC Motors
    4. Experiment 3: Stepper Motor
    5. Experiment 4: Stepper Motor Control
    6. Experiment 5: More Stepper Motor Control
  9. 6. Stroboscope Tachometer
    1. Finding a Fan
    2. Experiment 6: Detecting Speed
    3. Experiment 7: Stroboscope
    4. Experiment 8: Brighter Stroboscope
  10. 7. John Logie Baird’s TV
    1. Experiment 9: Persistence of Vision
    2. Experiment 10: John Logie Baird’s TV
  11. III. Electromechanics
  12. 8. Make a Simple Robot
    1. Experiment 11: Try Out a Servo Motor
    2. Experiment 12: Make a Simple Robot
    3. Experiment 13: Following Light
  13. 9. Pen Plotter
    1. Experiment 14: Pen Plotter
      1. Software
  14. 10. Digital Pinhole Camera
    1. Experiment 15: Making a Digital Camera
      1. Complete Listing
  15. 11. Printer
    1. Experiment 16: Making a Printer
      1. Software
      2. Complete Listing
  16. IV. Communication
  17. 12. Wired Communication
    1. Clocking
    2. Experiment 17: Making an Oscilloscope
      1. Using the Oscilloscope
  18. 13. Cutting the Cord: Infrared
    1. Experiment 18: Making the IR Receiver
    2. Experiment 19: Decoding IR Signals
    3. Experiment 20: Using Our Decoded Signal
    4. Experiment 21: Using Our Remote Control on the Net, with dweet.io
    5. Experiment 22: Using Our Remote Control on the Net, with IFTTT
  19. 14. Cutting the Cord: Radio Signals
    1. Experiment 23: Wiring Up the Receiver
    2. Experiment 24: Wiring Up a Transmitter
    3. Experiment 25: Transmitting from Espruino
    4. Experiment 26: Decoding the Received Data
  20. 15. Connecting with WiFi
    1. Experiment 27: Adding WiFi to Your Pico
      1. Making This Tidier
    2. Experiment 28: Testing Your Wiring
    3. Experiment 29: Connecting to WiFi
    4. Experiment 30: Sending Data to the Internet
    5. Experiment 31: Getting Data from the Internet
    6. Experiment 32: Creating a Server
    7. Controlling Things
  21. 16. Bluetooth Low Energy
    1. So, How Does Bluetooth Low Energy Work?
    2. How Can We Use Bluetooth LE Ourselves?
    3. Web Bluetooth
    4. Experiment 33: Using Puck.js
    5. Experiment 34: Making a Door Opening Counter
    6. Experiment 35: Advertising Door Openings
    7. Experiment 36: Receiving Door Openings with Eddystone
  22. V. Putting It All Together
  23. 17. XY Plotter
    1. Experiment 37: Making an XY Table
    2. Experiment 38: Controlling the XY Table
  24. 18. Internet-Connected Plotter
    1. Experiment 39: Internet-Connected Plotter
  25. VI. Conclusion
  26. 19. So What Now?
  27. A. Parts and Materials
    1. Common Parts
      1. General
      2. Espruino Boards
      3. Breadboard
      4. Patch Wires/Jumper Leads
      5. Resistors, Capacitors, LEDs, Light-Dependent Resistors
      6. Neodynium Magnets
      7. Single Core Wire
      8. Wood
    2. Motors Section
      1. General
      2. A Source of DC Power (Around 6–12v)
      3. L293D Motor Driver IC
      4. Brushless Fan
      5. P36NF06L FET
    3. Electromechanics Section
      1. General
      2. Servo Motors and Extension Wire
      3. Lobster Bands
      4. A Small Corkboard (Roughly 30cm×40cm)
      5. Threaded Rod and Nut
    4. Communication Section
      1. A Headphone Lead with a 3.5mm Jack Plug
      2. IR Receiver (HX1838, VS1838, TSOP348, or TSOP344) and Remote Control
      3. A 315Mhz (USA) or 433Mhz (Europe) Radio Transmitter/Receiver
      4. ESP8266 ESP01
    5. Putting It All Together
      1. 2x Springs
      2. Smooth Aluminum Bar and 30mm×30mm×30mm Cube of Solid Wood or Plastic
      3. 10×40mm Diameter Pulleys
      4. 5M of Fishing Line
      5. Two Small Geared Stepper Motors
  28. B. Common Espruino Commands and Variables
    1. print(text) or console.log(text)
    2. LED1 and LED2
    3. BTN1 or BTN
    4. digitalWrite(pin[s], value)
    5. digitalRead(pin[s])
    6. Pin.read(), Pin.write(value), Pin.set(), and Pin.reset()
    7. analogWrite(pin, value[, options])
    8. analogRead(pin)
    9. digitalPulse(pin, polarity, time[s])
    10. pinMode(pin, mode)
    11. reset()
    12. save()
    13. load()
    14. onInit()
  29. C. Espruino Assembler
    1. So How Do We Run This Code?
    2. Registers
    3. Instructions
    4. Getting More Complex
  30. Index

Product information

  • Title: Making Things Smart
  • Author(s): Gordon F. Williams
  • Release date: July 2017
  • Publisher(s): Make: Community
  • ISBN: 9781680451856