node.js /i2c control for the Adafruit PWM servo driver
Last updated 3 years ago by kaosat-dev .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install adafruit-i2c-pwm-driver 
SYNC missed versions from official npm registry.

Adafruit I2C PWM Driver

npm version

Node.js implementation for the Adafruit 16-Channel 12-bit PWM/Servo Driver


npm i adafruit-i2c-pwm-driver


const makePwmDriver = require('adafruit-i2c-pwm-driver')
const pwmDriver = makePwmDriver({address: 0x40, device: '/dev/i2c-1'})

pwmDriver.setPWM(2) // channel, on , off

To configure I2c on your Raspberry-pi / Beaglebone please see here

you can find a simple example here



Setting up a new PwmDriver

  • address: Address of the i2c panel, e.g. 0x20
  • device: Device name, e.g. '/dev/i2c-1' (defaults to /dev/i2c-1)
  • debug: flag used to display debug messages


Set the PWM frequency to the provided value (in hertz).

pwmDriver.setPWM(channel:Number, on:Number, off:Number)

Sets a single PWM channel.

pwmDriver.setALLPWM(channel:Number, on:Number, off:Number)

Sets all PWM channels.


PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.



Based on the Adafruit's Raspberry-Pi Python Code Library

Here is a growing collection of libraries and example python scripts for controlling a variety of Adafruit electronics with a Raspberry Pi

In progress!

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Limor Fried, Kevin Townsend and Mikey Sklar for Adafruit Industries. BSD license, all text above must be included in any redistribution

To download, we suggest logging into your Pi with Internet accessibility and typing: git clone

Standard - JavaScript Style Guide

Current Tags

  • 0.2.1                                ...           latest (3 years ago)

5 Versions

  • 0.2.1                                ...           3 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

Copyright 2014 - 2016 © |