gitmyhub

johnny-five

JavaScript ★ 13k updated 2y ago

JavaScript Robotics and IoT programming framework, developed at Bocoup.

A Node.js framework for programming robots and IoT devices using JavaScript, letting web developers control LEDs, motors, sensors, and displays on Arduino and other hardware boards without writing any C++.

JavaScriptNode.jsArduinoFirmatasetup: moderatecomplexity 3/5

Johnny-Five is a JavaScript framework for programming robots and IoT (Internet of Things) devices. It lets developers write Node.js code to control physical hardware like LEDs, motors, sensors, and displays, using the same JavaScript they might already know from web development.

The framework uses a protocol called Firmata to talk to the hardware. For Arduino boards, the setup involves uploading a Firmata sketch through the Arduino IDE once, and from that point forward your JavaScript code communicates with the board over USB without needing any C++ or low-level embedded code. A list of IO Plugins handles non-Arduino platforms like Raspberry Pi, BeagleBone, Intel Edison, and Tessel 2, so the same Johnny-Five API works across a wide range of devices.

The classic starting example blinks an LED on and off every half second in about five lines of code. From there the library provides APIs for servos, DC motors, sensors, buttons, accelerometers, temperature sensors, LCDs, piezo buzzers, and many other components. The project website at johnny-five.io has the full API reference, a large set of example programs, and wiring diagrams.

Johnny-Five was designed to serve as a base layer rather than a complete solution. It pairs with other JavaScript libraries: web servers like Express.js, real-time frameworks like Socket.io, Bluetooth game controllers, and drone control libraries. That composition model lets you build web-connected or browser-controlled hardware projects using tools from the existing Node.js ecosystem.

Installation is a single npm command. The full README is longer than what was shown.

Where it fits