In this section, we will discuss a project that can be applied to a home automation. We will dim an LED of DC, this can done to a lamp in a house. The LED will change its brightness, and we connect the LED to the GPIO18 of the Raspberry Pi in series with a resistor of 330 ohms.
First we need to install the
pigpio package. In the Terminal, type the following:
Then unzip the package:
After that, navigate to the unzipped folder with the following:
Type the following to execute the command:
Finally install the file:
sudo make install
In this section, we will test the sensor with a script in Node.js:
var Gpio = require('pigpio').Gpio; ...