Skip to main content

Lighting A LED Using Raspberry Pi

Lights? Cool ha?
Lights are an easy way to express indications for any process, they are like little alerts or notifications.

Today, let's learn how to set up a LED with a Raspberry Pi.

You should already know how to log in via SSH and use Filezilla. If you don't know how to, then follow the links below:
SSH - click here
Filezilla - click here

To see the practical demonstration, watch the video below.


Things you'll need:
  • Raspberry Pi
  • Power source for Pi
  • A LED
  • Resistor (330 Ω)
  • Breadboard
  • Male to female jumper cables
Assemble your circuit as shown below:

Note: Make sure you connect the positive end of the LED to GPIO 21 and the negative end to Ground PIN

Now turn on your Raspberry Pi and copy the LED.py file to /home/pi/ using Filezilla
Download LED.py here

Now open terminal and type the following:
sudo python LED.py

Your LED should now blink 4 times with a delay of 2 seconds.

To exit the program press:
Ctrl+C

You can also edit the code if you feel like experimenting. Type:
sudo nano LED.py

Save your changes by pressing:
Ctrl + X, Y then press Enter

Have fun with your light set up and let me know about it in the comments!

Comments

Popular posts from this blog

Raspberry Pi Music Player

Love Music? Or are too nerdy to make your own gadgets! (That was one of mine reasons. Duh!) Well, this is the Raspberry Pi Music Player. Watch the video below to find out what it is like Features: Control over bluetooth (smartphone) Commands can be given via voice (smartphone) Play Next Stop Increase Volume Decrease Volume First Song Date Time Shut Down LCD On LCD Off LCD Brightness Control Additional Info: I also installed Rune Audio on my other SD Card so that I could use it over my WiFi. But yes, that requires switching cards. But that makes it portable with a web interface. Currently facing problems with: Running without Ethernet plugged in on boot (worked perfectly fine with previous versions of Raspbian). Wanting to do this to make it portable. Repeat Functionality Shuffle Playing songs from USB And a few more bugs Write to me at sparkthatplug@gmail.com if you think you can help me with those problems. Innovative ideas are always...

Sharing Files With Raspberry Pi

Uploading files directly from your PC to your Pi without Internet? Yes it is possible! Downloading from it is possible too. For this to work you should already know how to connect to Raspberry Pi via SSH If you don't then click here to find out. Watch the video on how to share files: The sftp (SSH File Transfer Protocol) makes the whole process possible. To use it: Download and install FileZilla - download link  here Open FileZilla, in the top left corner enter your Pi's IP address in the Host column In username filed enter 'pi' In the password filed enter the password for your Pi Enter 22 in Port and hit Quickconnect You should now see files on your computer on the left and files on your Raspberry Pi on the right. Now you can access all the files like you do on a normal computer. You can download and upload files. It also has many other options like like making a file executable which is similar to the command chmod that we use in the terminal. FileZilla...

COMING SOON!

Hey! Its my new blog,  Spark That Plug This blog will be all about my adventures with electronics and the things that catch my interest. I'll try and publish the most easy tutorials for those tech-savy people out there! Simple DIYs, here I come! I'll also help with technology related problems and post solutions to the problems that we run into our daily lives. I'm no perfect person, I mess up things too! Hahaha! So, I'll be asking for help at times too! Well, not just this I might also share my funny experiences in life. After all, life is full or surprises, ya know! (Hint : Raspberry!)