Once your LED is wired up and connect to your Raspberry Pi, you can add it to the Cayenne dashboard. Let’s add a Light Switch to control our light.
1. From the online dashboard, locate the Add new menu and select the Device entry.
2. On the Add Device screen you will see categories containing various sensors and devices that can be added. The switch that we want to add is located in the Actuators category. Since we want to add a light switch, locate the Light tile and click on it to continue.
3. From the list of Light devices that appears, find and click on the Light Switch tile.
4. In order to add our new light switch widget to the dashboard, we will need to fill in a few details first.
Name: Enter “Light Switch” for the name of our new widget.
Icon: Select the Light icon from the list of icons.
GPIO: Our LED is connected directly to the Raspberry Pi, so make sure the Integrated GPIO is selected in the GPIO list.
Channel: When setting up our LED we wired the light to GPIO 17. Select 17 in the list of channels
Invert Logic: We want the light to start off and then turn on as we activate the button, so make sure that the Invert Logic is set to No.
6. Click Add Sensor to complete adding your switch. You will then be returned to the Dashboard where you will see your new switch added.