0.1.10 • Published 10 months ago

@okee-tech/rppal v0.1.10

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@okee-tech/rppal

Node.js bindings for the rppal Rust crate to control Raspberry Pi peripherals.

Requirements

  • Raspberry Pi hardware
  • Node.js 16.0.0 or higher

Installation

npm install @okee-tech/rppal

Features

  • GPIO
  • GPIO Software PWM
  • I2C (no smbus for now)

Usage

GPIO Example

import { Gpio, Mode, Bias } from "@okee-tech/rppal";

const gpio = new Gpio();
const pOut = gpio.get(2);
const pIn = gpio.get(3);
const pPwm = gpio.get(4);
pOut.mode = Mode.Output;
pIn.mode = Mode.Input;
pIn.bias = Bias.PullDown;
pPwm.mode = Mode.Output;

pPwm.setPwm(10, 0.5);
for (;;) {
  pOut.value = pOut.value ? 0 : 1;
  console.log("Input value: ", pIn.value);

  await new Promise((resolve) => setTimeout(resolve, 200));
}

License

MIT

Contributing

Issues and pull requests are welcome on GitHub.

0.1.10

10 months ago

0.1.9

10 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago