New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

p5bots

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p5bots

Get sensor data into your p5 sketches

  • 0.3.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Welcome to p5bots!

  • How Does This Work?
  • p5.Serial
  • p5.Board
  • Getting Started
  • Finding Informataion
  • Issues
  • Contributing

How Does This Work?

p5.bots is a library to facilitate communication between p5.js running in your browser and a microcontroller* running Firmata**.

``` * The library has been tested on Arduino Unos, but should work on anything running Firmata. ** The serial API does not depend on Firmata. ```

To do this, it uses the socket.io library and node.js to send messages between the two devices, in a language each device can understand.

This way, you can click on a sketch to light an LED or use temperature data to drive a sketch — or more.

diagram of client, server, and microcontroller

p5bots comprises two sets of files: the client file, called p5bots.js, which is included in the index.html along with p5.js and your sketch; and the server files, called p5bots-server, which can be downloaded from npm.

p5.Serial

p5bots has a p5.serial method that can be used in combination with an Arduino sketch listening for serial, much in the same way the Processing serial library can.

For more details on this module, see serial in the API reference.

If you use serial only, you do not need to install Firmata on your board.

p5.Board

The majority of p5bots functionality lives within p5.board. Inspired by Johnny-Five, p5.board provides a number of hardware-specific methods in addition to plain digital, analog, and pwm read/write methods.

Details for these methods, plus examples can be found in the module pages. Example sketches and hardware diagrams are also available in the examples directory.

Getting Started

Ready to go? Good entry points include:

Finding Infomation

Detailed explanations of functionality have been broken up by subject:

  • Getting set up and using the library with p5.js: p5.bots API
  • Setting up and testing the server files: p5.bots server
  • Examples showing p5.bots alongside p5 functions: examples

Issues

Report issues in this repo.

Contributing

Want to fix an issue you've identified? Looking to create some functionality we have yet to add? Check out CONTRIBUTING.md.

License

LGPL

FAQs

Package last updated on 02 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc