Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thrsouza/cheesecake

Cheesecake is the best option for Raspberry Pi with Nodejs!
https://github.com/thrsouza/cheesecake

cheesecake gpio io iot pi raspberry raspi rpi

Last synced: 2 months ago
JSON representation

Cheesecake is the best option for Raspberry Pi with Nodejs!

Awesome Lists containing this project

README

        


Cheesecake


Cheesecake is the best option for Raspberry Pi with Nodejs!

## 📖 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:

```sh
$ npm i cheesecakejs --save
```

## 👨🏽‍💻 Example

```js
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.

GPIO Diagram


REFERENCE: https://www.raspberrypi.org/documentation/usage/gpio/

## 📃 Contributing

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

- [Contributing](./.github/CONTRIBUTING.md)
- [Code of Conduct](./.github/CODE_OF_CONDUCT.md)

## 📮 Contact

We have a few channels for contact:

- Email: [[email protected]](mailto:[email protected])
- [GitHub Issues](https://github.com/thiagodesouza/cheesecake/issues)

## 📃 License

MIT © [Cheesecake](https://github.com/thiagodesouza/cheesecake/)