2 options
Learning JavaScript robotics : design, build, and program your own remarkable robots with JavaScript and open source hardware / Kassandra Perch.
- Format:
- Book
- Author/Creator:
- Perch, Kassandra, author.
- Series:
- Community experience distilled.
- Community experience distilled
- Language:
- English
- Subjects (All):
- JavaScript (Computer program language).
- Video games--Handbooks, manuals, etc.
- Video games.
- Physical Description:
- 1 online resource (160 p.)
- Edition:
- 1st ed.
- Place of Publication:
- Birmingham : Packt Publishing, 2015.
- Biography/History:
- Perch Kassandra: Kassandra Perch is an open web developer and supporter. She began as a frontend developer and moved to server-side with the advent of Node. js and was especially enthralled by the advance of the NodeBots community. She travels the world speaking at conferences about NodeBots and the fantastic community around them.
- Summary:
- About This BookLearn how to leverage Johnny-Five's Read, Eval, Print Loop, and Event API to write robot code with JavaScriptUnlock a world of exciting possibilities by hooking your JavaScript-programmed robots up to the internet and using external data and APIsMove your project code from the Arduino Uno to a multitude of other robotics platformsWho This Book Is For If you've worked with Arduino before, or are new to electronics and would like to try writing sketches in JavaScript, then this book is for you! Basic knowledge of JavaScript and Node.JS will help you get the most out of this book.What You Will LearnFamiliarize yourself with Johnny-Five Read-Eval-Print-Loop (REPL)Build robots with basic output devicesCreate projects with complex output devices and employ the Johnny-Five API to simplify the use of components that require complex interfaces, such as I2CUse the servo and motor objects to make it much easier to move your robotics projectsLearn about the Animation API which allows you to program complex movements using timing and key framesBring other devices into your Johnny-Five projects, such as USB devicesConnect your Johnny-Five projects to external APIs and create your own Internet of Things!In Detail There has been a rapid rise in the use of JavaScript in recent times for a variety of applications and JavaScript robotics has also seen a rise in popularity. Johnny-Five is a framework that gives NodeBots a consistent API across several hardware systems. This book walks you through basic robotics projects, including the physical hardware builds and the JavaScript code for them. You'll delve into the concepts of Johnny-Five and JavaScript robotics. You'll learn about various components, such as Digital GPIO pins, PWM output pins, sensors, servos, and motors to be used with Johnny-Five, along with some advanced components that use I2C and SPI. You will learn to connect your Johnny-Five robots to internet services. By the end of this book, you will have explored the benefits of the Johnny-Five framework and the many devices it unlocks.
- Contents:
- Cover
- Copyright
- Credits
- About the Author
- About the Reviewers
- www.PacktPub.com
- Table of Contents
- Preface
- Chapter 1: Getting Started with JS Robotics
- Understanding JS Robotics, NodeBots, and Johnny-Five
- What a NodeBot is, and other basic vocabulary
- Johnny-Five and the NodeBot revolution
- What we'll be using in this book
- Setting up your development environment
- Installing Node.JS
- Setting up your project and installing Johnny-Five
- Connecting your Microcontroller and installing Firmata
- Hello, World! - Blinking an onboard LED
- Writing the Johnny-Five script
- Running the script
- Summary
- Chapter 2: Working with Johnny-Five
- What you'll need for this chapter
- How a Johnny-Five program works
- Objects, functions, and events
- Going over our blink-LED script
- Understanding events in Johnny-Five
- Why events?
- Wiring up an external LED
- Setting up the hardware
- Using the Read, Eval, Print Loop (REPL)
- Making components available to the REPL
- Using the REPL
- Chapter 3: Using Digital and PWM Output Pins
- How GPIO pins work
- Digital output pins
- PWM output pins
- How to tell the difference between Digital and PWM pins
- Multiple pins with several LEDs
- Setting up the hardware for the project
- Writing the script for the project
- Exploring more about LED objects in Johnny-Five
- Using PWM pins with the Piezo element
- Writing the script
- What's going on with the pin?
- Exploring the Piezo API
- Chapter 4: Using Specialized Output Devices
- Outputs that require multiple pins
- Inter-Integrated Circuits (i2c)
- Checking compatibility with Johnny-Five
- Obtaining documentation, wiring diagrams, and so on.
- The project - character LCD display
- Wiring up - i2c LCDs
- The code
- The i2c version
- The non-i2c version
- Running the code
- Chapter 5: Using Input Devices and Sensors
- How analog input pins work
- Johnny-Five sensor events
- Using basic inputs - buttons and potentiometers
- Wiring up our button and LED
- Coding button-led.js
- Wiring the potentiometer and the LED
- Coding our dimmer switch
- Using sensors - Light and Temperature
- Wiring up our photocell
- Coding our photocell example
- barcli
- Coding everything together
- Wiring up the temperature sensor
- Coding our temperature example
- Chapter 6: Moving Your Bot
- The different kinds of servos and motors
- Defining motors and servos
- Things to keep in mind
- Types of motors
- Types of servos
- Do I use a servo or a motor?
- Servo and motor controllers
- Motor and servo shields
- Special concerns when using motors and servos
- Power concerns
- Tethering and cables
- Wiring up servos and motors
- Wiring up servos
- Wiring up motors
- Creating a project with a motor and using the REPL
- Exploring the motor API
- Creating a project with a servo and a sensor
- Exploring the servo API with the REPL
- Chapter 7: Advanced Movement with the Animation Library
- What is the Animation API?
- Why do we need an Animation API?
- Why animation?
- Looking at the Animation API
- Learning the terminology
- The difference between .to() and the Animation API
- Using the ServoArray object
- Project - wiring up three servos and creating an array
- Writing Servo Animations
- Writing key frames
- The key frame object
- Key frame shorthand
- Examples of writing key frames
- Writing segments
- Segment options.
- Examples of writing segments
- The Animation object
- Project - animating our servo array
- Animation events
- Building a servo array with an informative LCD readout
- Chapter 8: Advanced Components - I2C, SPI, and Other Devices
- Why do we need the I2C and SPI protocols?
- Exploring SPI (Serial Peripheral Interface) devices
- How SPI works
- How Johnny-Five does SPI
- Benefits and drawbacks of SPI
- Building with an SPI device - an LED matrix
- The build
- The API
- Exploring I2C devices
- How I2C works
- Pins used by I2C
- How I2C devices send and receive data
- Benefits and drawbacks of I2C
- Benefits
- Drawbacks
- Building with an I2C device - Accelerometer
- Wiring up our accelerometer
- Coding up our example
- External Devices
- Why External Devices?
- node-serialport
- node-hid
- Build - a USB gamepad
- The hardware
- The node-gamepad API
- Chapter 9: Connecting NodeBots to the World, and Where to Go Next
- Connecting NodeBots to the Web
- It's just a Node Server!
- Using Twilio
- Building the WeatherBot
- Using the TextBot
- Johnny-Five and the wide world of microcontrollers
- Moving our WeatherBot to the Particle Photon
- Tethering and Johnny-Five
- Other JS libraries and platforms
- Espruino
- Tessel
- Cylon.js
- JerryScript
- Tiny Linux computers
- Vendor libraries
- Where to go from here
- Index.
- Notes:
- Includes index.
- Description based on online resource; title from PDF title page (ebrary, viewed January 5, 2016).
- ISBN:
- 9781785880872
- 178588087X
The Penn Libraries is committed to describing library materials using current, accurate, and responsible language. If you discover outdated or inaccurate language, please fill out this feedback form to report it and suggest alternative language.