GrovePi+ Project 1: Fading Two LEDs Simultaneously!

Thursday, September 08, 2016

I'm starting off my first electronic project with the GrovePi+  by fading one LED and then two LEDs at the same time. All the hardware required already comes with the GrovePi+ starter kit and I have already my Raspberry Pi network set up from my previous project with the GoPiGo robot car.

To login to the Raspberry Pi desktop, I use Windows' Remote Desktop Connection and type in the username (pi) and password (robots1234).

From there, it's just a simple case of accessing the example containing the source code of the LED Fade, which is already provided by Dexter Industries.

To run the code, I open up LX Terminal and enter cd Desktop/ followed by cd GrovePi/, cd Projects/, cd LED_Fade/. Then, enter sudo pyton to execute the code

To fade two LEDs  at the same time, I simply added to the code the following line below:

Setting up the hardware was pretty straightforward. Insert the LEDs in their modules and connect the rotary angle sensor and cables in their respective ports.

In this case, the LEDs connect to D5 and D6 ports; while the rotary angle sensor (potentionmeter) connects to port A2 on the GrovePi+ board. Both the GrovePi board and Raspberry Pi board are powered off mains electricity via the Raspberry Pi's micro USB port. Keep in mind also that the LEDS have a minus and plus polarity so be sure to insert the LEDS the correct way.

Blue LED and Green LED
You may need to increase the brightness of the LED as it may be set to low. All you do is turn the yellow screw clockwise.

Similar Gadget Explained Reviews


Connect With Gadget Explained