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
Just add cheesecake to your Nodejs project for Raspberry Pi:
$ npm i cheesecakejs --save
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();
});
A powerful feature of the Raspberry Pi is the row of GPIO pins along the top edge of the board.
REFERENCE: https://www.raspberrypi.org/documentation/usage/gpio/Thanks for your interest on our project. Take a moment to read our guidelines:
We have a few channels for contact:
- Email: [email protected]
- GitHub Issues
MIT © Cheesecake