0.1.0 • Published 4 years ago

cheesecakejs v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

📖 Overview

This package was created to help Nodejs developers create projects to work with the Raspberry PI GPIO pins in a simple way. Why did I choose this name? Because I ❤️ cheesecake and that's enough! :D

‍🚀 Installation

Just add cheesecake to your Nodejs project for Raspberry Pi:

$ npm i cheesecakejs --save

👨🏽‍💻 Example

const { Gpio, GpioValue, GpioDirection } = require('cheesecakejs');

const gpio4 = new Gpio(4, GpioDirection.OUT);

gpio4.onValueChanged((data) => {
  const dateTime = new Date().toJSON();
  console.log(`${dateTime} - Gpio${gpio4.gpio}: new value => ${data}`);
});

setInterval(() => {
  const value = gpio4.getValue();
  gpio4.setValue(Boolean(value) ? GpioValue.LOW : GpioValue.HIGH);
}, 1000);

process.on('SIGINT', () => {
  console.log('Please, await...');
  gpio4.dispose();
  process.exit();
});

📕 GPIO Pins Diagram

A powerful feature of the Raspberry Pi is the row of GPIO pins along the top edge of the board.

📃 Contributing

Thanks for your interest on our project. Take a moment to read our guidelines:

📮 Contact

We have a few channels for contact:

📃 License

MIT © Cheesecake