johnny-five README

The project's README from github.com/rwaldron/johnny-five. As one markdown file: README.md.

Johnny-Five

The JavaScript Robotics Programming Framework

Artwork by Mike Sgier

Build, Lint, Test and Measure Coverage Appveyor Build Status Coverage Status Install Size Gitter

Johnny-Five is an Open Source, Firmata Protocol based, IoT and Robotics programming framework, developed by the Nodebots Community. Johnny-Five programs can be written for Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!

Johnny-Five has grown from a passion project into a tool for inspiring learning and creativity for people of all ages, backgrounds, and from all across the world.

Just interested in learning and building awesome things? You might want to start with the official Johnny-Five website.

Johnny-Five does not attempt to provide "all the things", but instead focuses on delivering robust, reality tested, highly composable APIs that behave consistently across all supported hardware platforms. Johnny-Five wants to be a baseline control kit for hardware projects, allowing you the freedom to build, grow and experiment with diverse JavaScript libraries of your own choice. Johnny-Five couples comfortably with:

...And that's only a few of the many explorable possibilities. Check out these exciting projects: node-pulsesensor, footballbot-workshop-ui, nodebotui, dublin-disco, node-slot-car-bot, servo-calibrator, node-ardx, nodebot-workshop, phone-home, purple-unicorn, webduino, leapduino, lasercat-workshop, simplesense, five-redbot, robotnik, the-blender

Why JavaScript? NodeBots: The Rise of JavaScript Robotics

Hello Johnny

The ubiquitous "Hello World" program of the microcontroller and SoC world is "blink an LED". The following code demonstrates how this is done using the Johnny-Five framework.

const { Board, Led } = require("johnny-five");
const board = new Board();

board.on("ready", () => {
  // Create an Led on pin 13
  const led = new Led(13);
  // Blink every half second
  led.blink(500);
});

Note: Node will crash if you try to run johnny-five in the node REPL, but board instances will create their own contextual REPL. Put your script in a file.

Supported Hardware

Johnny-Five has been tested on a variety of Arduino-compatible Boards.

For non-Arduino based projects, a number of platform-specific IO Plugins are available. IO Plugins allow Johnny-Five code to communicate with any non-Arduino based hardware in whatever language that platforms speaks!

Documentation

Documentation for the Johnny-Five API can be found here and example programs here.

Guidance

Need help? Ask a question on the NodeBots Community Forum. If you just have a quick question or are interested in ongoing design discussions, join us in the Johnny-Five Gitter Chat.

For step-by-step examples, including an electronics primer, check out Arduino Experimenter's Guide for NodeJS by @AnnaGerber

Here is a list of prerequisites for Linux, OSX or Windows.

Check out the bluetooth guide if you want to remotely control your robot.

Setup and Assemble Arduino

If the upload was successful, the board is now prepared and you can close the Arduino IDE.

For non-Arduino projects, each IO Plugin's repo will provide its own platform specific setup instructions.

Hey you, here's Johnny!

Source Code:

git clone git://github.com/rwaldron/johnny-five.git && cd johnny-five

npm install

npm package:

Install the module with:

npm install johnny-five

Example Programs

To get you up and running quickly, we provide a variety of examples for using each Johnny-Five component. One thing we’re especially excited about is the extensive collection of Fritzing diagrams you’ll find throughout the site. A huge part of doing any Johnny-Five project is handling the actual hardware, and we’ve included these as part of the documentation because we realised that instructions on how to write code to control a servo are insufficient without instructions on how to connect a servo!

To interactively navigate the examples, visit the Johnny-Five examples page on the official website. If you want to link directly to the examples in this repo, you can use one of the following links.

There are presently 362 example programs with code and diagrams!

Board

LED

LED: RGB

LED: Digits & Matrix

Servo

GPS

Servo Animation

Color

Motor

Stepper Motor

ESC & Brushless Motor

Button / Switch

Keypad

Relay

Shift Register

Infrared Reflectance

Proximity

Motion

Joystick

LCD

Compass/Magnetometer

Piezo

IMU/Multi

Sensors

Expander

Photon Weather Shield

Lego EVShield

Intel Edison + Grove IoT Kit

Grove IoT Kit (Seeed Studio)

Micro Magician V2

TinkerKit

Wii

Complete Bots / Projects

Component Plugin Template

IO Plugins

Many fragments. Some large, some small.

Wireless Nodebot

Kinect Controlled Robot Arm

Biped Nodebot

LCD Running Man

Slider Controlled Panning Servo

Joystick Controlled Laser (pan/tilt) 1

Joystick Controlled Laser (pan/tilt) 2

Joystick Controlled Claw

Robot Claw

Joystick, Motor & Led

Build you own drone

Make: JavaScript Robotics

Contributing

All contributions must adhere to the Idiomatic.js Style Guide, by maintaining the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

License

Copyright (c) 2012, 2013, 2014 Rick Waldron [email protected] Licensed under the MIT license. Copyright (c) 2014, 2015 The Johnny-Five Contributors Licensed under the MIT license.

johnny-five (rwaldron/johnny-five)

Searching Database…

这是什么?Johnny-Five 是一个基于 Firmata 协议的开源 JavaScript 框架,用于机器人和物联网开发,让你可以用 JS 代码控制 Arduino、Raspberry Pi、Tessel 2 和 Intel Edison 等硬件。
它是我可以加到自己 Node.js 项目里的框架,还是独立的应用?它是一个 npm 包/框架,你在自己的 Node.js 脚本里通过 require 引入它,它提供可组合的 API,用于控制 LED、舵机、电机和传感器,而不是试图包办一切。
我怎样才能让第一个 LED 闪烁起来?在 Arduino IDE 中(文件 > 示例 > Firmata)把 StandardFirmataPlus 草图烧录到你的 Arduino 上,然后安装 johnny-five npm 包,并编写一个基于 Board 对象的小脚本。
使用它是否必须有真正的 Arduino 或其他开发板?是的。Johnny-Five 通过 Firmata 与硬件通信,因此你需要一块受支持的开发板,例如 Arduino、Beagle Bone、Intel Galileo/Edison、Raspberry Pi、Particle Photon 或 Tessel 2。
所有受支持的开发板,设置方法都一样吗?兼容 Arduino 的开发板只需要 StandardFirmataPlus 草图,但非 Arduino 平台各自需要专门的 IO 插件,并有各自的设置步骤。
我可以在 Windows、macOS 或 Linux 上开发吗?可以。项目为这三种桌面操作系统都提供了前置环境设置指南,用于编写和运行你的 Johnny-Five 程序。
它自带多少个示例程序?有 362 个现成的示例程序,涵盖 LED、电机、传感器等内容,每个示例都附有代码和 Fritzing 接线图。
我能把它和其他 JS 工具结合使用吗?可以。Johnny-Five 设计上可以与 Express.js、Socket.io 等库搭配,也可以与 AR.Drone 等其他硬件项目以及 Octoblu 等物联网框架配合使用。
我能通过蓝牙控制机器人吗?可以。README 中链接了一份专门的蓝牙指南,介绍如何远程控制你的机器人,此外该框架还支持 Xbox、DualShock 等游戏手柄。
在哪里可以找到完整的组件 API 文档?完整的 API 文档,以及附带 Fritzing 接线图的组件示例库,都托管在 Johnny-Five 官方网站上。
Creator
rwaldron
Size
92.8 MB
Stars
13.4K
Age
14y
Commits · 90 Days