Basic LED blinking w/ Raspberry Pi

Now I’m not going to show how to setup Raspbian or SSH with your Pi. There are tons of tutorials online how to do that. I will however guide you through to setting up the necessary software for Raspbian to be able to control the pins on the Raspberry Pi.

Requirements

  • Working Raspbian OS
  • SSH connection or keyboard and display hooked up to Raspberry Pi
  • Two breadboard jumper wires female to male
  • 330 Ω resistor
  • LED

Connecting the components

Now, the pins on the Raspberry Pi are usually called the GPIO pins, which is short for General-Purpose Input/Output. This is explained so you don’t get confused whenever you hear “gpio”  in the forums. These pins are layed out with in two headers if you have the Mod B rev. 2 version. If you have another version you should only have one header. These two headers are called P1 and P5. The P5 is the header only available on the Mod B rev.2, and it’s purpose is to give the possibility to connect from under the Raspberry Pi. P1 is the header we will be using and is available throughout the different Pi models.

Observe! This pin layout is for the Raspberry Pi Mod B rev. 2!. Make sure you have this model before using the below layout as cheat sheet!

gpiopins

Raspberry Pi Mod B rev. 2 pin layout

 

Connect the first female-male wire from the GPIO 17 to the resistor, the resistor should connect the the anode of the LED. The LED’s cathode should connect to the second wire and the wire should then connect to one of the GND-pins

So GPIO 17 –> wire –> resistor –> LED’s anode –> LED’s cathode –> wire –> GND pin

Installing the required software

Next is to get the software ready. There are several ways to control the GPIO pins with software. The easiest way is to use GPIO-utility which is supplied by WiringPi.
To install WiringPi run these commands:

git clone git://git.drogon.net/wiringPi
cd wiringPi
cd wiringPi
./build

Turning the LED on and off

When the installation is done you can now use the GPIO-utility by running

gpio -g mode 17 out

The code about sets the GPIO 17 pin as output for +3.3V.

To turn on the LED run this code:

gpio -g write 17 1

Here’s how it looks on my end:

rpiled

LED in the HIGH state

To turn the LED off again run

gpio -g write 17 0

 

If you have any questions feel free to ask me by using the Contact page or the comments below.

Prince

A second year computer engineering student at Malmö University in Sweden just having some fun with this blog. Computer Engineering and Mobile IT: Bachelor of Science in engineering

You may also like...

60 Responses

  1. tips for anxiety attacks says:

    Hello very cool website!! Man .. Excellent .. Superb .. I’ll bookmark your website and take the feeds also? I’m happy to find a lot of useful information right here in the publish, we need develop extra techniques on this regard, thank you for sharing.

    • diplind says:

      The search was performed in March 2012, using the terms randomized and cancer as keywords and English plus clinical trials or randomized controlled trial as limits buy cialis online united states But do yourself a favour, eat only organic fruit as apples are the number one food that contain pesticides which are toxic enough to severely affect an already overwhelmed brain

  2. exposed skin care says:

    I like the helpful information you provide in your articles. I will bookmark your blog and check again here regularly. I’m quite sure I’ll learn many new stuff right here! Best of luck for the next!

  3. I like this web site very much, Its a very nice post to read and receive information.

  4. What i don’t realize is in reality how you are no longer actually a lot more well-favored than you might be now. You’re very intelligent. You realize thus significantly in terms of this matter, produced me in my opinion imagine it from numerous numerous angles. Its like women and men don’t seem to be fascinated until it is something to accomplish with Girl gaga! Your own stuffs excellent. At all times take care of it up!

    • diplind says:

      K Assisting, encouraging, aiding, abetting, conspiring, covering up, or any other type of intentional complicity involving a safety, performance, or anti doping and medication control rule violation or the violation of a period of suspension or eligibility tadalafil cialis 14B E and Figure S15

  5. Augmest says:

    show 2 more Substituents 2, 4, 5 trisubstituted 1, 3 oxazole Aromatic heteromonocyclic compound Azacycle Benzenoid Carbonyl group Carboxylic acid Carboxylic acid derivative Heteroaromatic compound Hydrocarbon derivative Monocarboxylic acid or derivatives Monocyclic benzene moiety Organic nitrogen compound Organic oxide Organic oxygen compound Organonitrogen compound Organooxygen compound Organopnictogen compound Oxacycle Phenyl 1, 3 oxazole buying cialis online usa

    • diplind says:

      Study results suggest that 2 year HCT therapy including the oral 5 FU anti cancer drug HCFU is a useful adjuvant therapy which can replace CMFT therapy in early breast cancer cases with 3 or lower metastatic lymph nodes tamoxifen male side effects Using the KDIGO definition, 1 in 5 adults 21

  6. fabcouture says:

    Thanks for your publish. My spouse and i have often seen that a lot of people are desperate to lose weight when they wish to look slim and attractive. However, they do not always realize that there are more benefits just for losing weight as well. Doctors declare that obese people come across a variety of illnesses that can be instantly attributed to their excess weight. The great news is that people who definitely are overweight as well as suffering from a variety of diseases can help to eliminate the severity of their illnesses through losing weight. It is easy to see a progressive but noted improvement in health whenever even a small amount of weight reduction is achieved.

  7. Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point. You clearly know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something enlightening to read?

  8. I was looking at some of your articles on this site and I think this internet site is really informative ! Continue posting.

  9. Hello there! This post couldn’t be written any better! Reading through this post reminds me of my previous room mate! He always kept talking about this. I will forward this write-up to him. Pretty sure he will have a good read. Many thanks for sharing!

  10. Este site é realmente fabuloso. Sempre que acesso eu encontro coisas diferentes Você também vai querer acessar o nosso site e saber mais detalhes! Conteúdo exclusivo. Venha saber mais agora! 🙂

  11. Would love to incessantly get updated outstanding website! .

  12. Jamesenund says:

    https://over-the-counter-drug.com/# over the counter anti nausea medication

  13. albulty says:

    uses for clomid How much cytotec abortion pills in Qatar Doha

  14. gate io says:

    Your article helped me a lot, thanks for the information. I also like your blog theme, can you tell me how you did it?

  15. gate io says:

    Your article helped me a lot, thanks for the information. I also like your blog theme, can you tell me how you did it?

  16. CaM says:

    Also known as IPL, this cricket league is hosted and played in India with teams or clubs from different Indian cities. One of the most followed and highly wagered tournaments, IPL has a high bet market due to the presence of both Indian and International players playing together in each team. The very mix of International and Domestic players in every team means more excitement and more power-packed performances to bet on. IPL has become a brand across all the cricket playing countries despite being an Indian league, thus this series has found its place in all major online cricket betting websites. The IPL’s first major international media deal was with YouTube, which streamed matches in 2010 outside of the United States (where Willow TV has held linear television rights to the IPL) under a two-year deal.
    https://bbdeals.net/community/profile/chetblackall566/
    Average processing times for visit visas and work and invest visas updated. For all betting related promotions and bonuses. 18+ Only. Please gamble responsibly! All odds quoted correct at time of publishing and subject to change. Two games and OUT! Fabrizio Romano is often referred to as the “King of Football Transfer News”. He has been working with Sky Sports in… read more You can join my colleague Luke Bissett with our live blog for Fulham vs Liverpool. Part of the Daily Mail, The Mail on Sunday & Metro Media Group Bootle have announced the signing of central midfielder Billy Smart. Whitby Town have completed the signing of striker Connor Simpson. Part of the Daily Mail, The Mail on Sunday & Metro Media Group Brazil duo Neymar and Danilo will miss their country’s remaining two World Cup group games and face a fight to be fit for the knockout stage after sustaining injuries in…

  17. With havin so much written content do you ever run into any problems of plagorism or copyright violation? My blog has a lot of exclusive content I’ve either authored myself or outsourced but it appears a lot of it is popping it up all over the web without my authorization. Do you know any techniques to help protect against content from being stolen? I’d certainly appreciate it.

  18. Hello! I know this is kind of off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having difficulty finding one? Thanks a lot!

  19. Wheel Loader says:

    Great post, I conceive people should learn a lot from this blog its real user pleasant.

  20. coin al says:

    Reading your article helped me a lot and I agree with you. But I still have some doubts, can you clarify for me? I’ll keep an eye out for your answers.

  21. Exactly what I was looking for, appreciate it for putting up.

  22. There may be noticeably a bundle to learn about this. I assume you made certain good factors in features also.

  23. I must show my affection for your generosity for folks that must have help with this one content. Your special dedication to getting the message all through had been exceedingly advantageous and have surely helped most people like me to attain their targets. Your invaluable suggestions can mean a whole lot a person like me and still more to my peers. With thanks; from everyone of us.

  24. I’ve been exploring for a little bit for any high quality articles or blog posts on this kind of area . Exploring in Yahoo I at last stumbled upon this site. Reading this info So i am happy to convey that I have an incredibly good uncanny feeling I discovered just what I needed. I most certainly will make certain to do not forget this web site and give it a glance on a constant basis.

  25. live22 says:

    Hi this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding expertise so I wanted to get advice from someone with experience. Any help would be greatly appreciated!

  26. I used to be very happy to search out this web-site.I needed to thanks on your time for this wonderful learn!! I undoubtedly having fun with each little bit of it and I have you bookmarked to take a look at new stuff you weblog post.

  27. I keep listening to the news broadcast talk about getting free online grant applications so I have been looking around for the finest site to get one. Could you tell me please, where could i get some?

  28. F*ckin’ awesome things here. I am very glad to see your post. Thanks a lot and i’m looking forward to contact you. Will you please drop me a e-mail?

  29. Just want to say your article is as astounding. The clarity in your post is simply great and i can assume you are an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please carry on the enjoyable work.

  30. I’ve been browsing online more than 3 hours today, yet I never found any interesting article like yours. It is pretty worth enough for me. In my view, if all web owners and bloggers made good content as you did, the net will be a lot more useful than ever before.

  31. Get-X – онлайн игра с реальным выводом средств. В неё входят азартные игры, где можно делать ставки, например, Краш.

  32. What’s Happening i’m new to this, I stumbled upon this I’ve found It absolutely helpful and it has aided me out loads. I hope to contribute & help other users like its aided me. Good job.

  33. I think this is one of the most significant information for me. And i am glad reading your article. But want to remark on few general things, The site style is great, the articles is really excellent : D. Good job, cheers

  34. I like what you guys are up also. Such intelligent work and reporting! Keep up the excellent works guys I have incorporated you guys to my blogroll. I think it will improve the value of my web site 🙂

  35. Thanks, I have recently been looking for information approximately this subject for ages and yours is the best I have discovered till now. However, what concerning the conclusion? Are you certain in regards to the source?

  36. I’d have to examine with you here. Which is not one thing I usually do! I take pleasure in reading a post that may make folks think. Additionally, thanks for permitting me to comment!

  37. Very nice post. I just stumbled upon your blog and wanted to say that I’ve really enjoyed browsing your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!

  38. I have been exploring for a little bit for any high quality articles or weblog posts in this sort of area . Exploring in Yahoo I ultimately stumbled upon this website. Studying this information So i¦m glad to exhibit that I’ve a very just right uncanny feeling I found out exactly what I needed. I so much undoubtedly will make certain to do not omit this web site and provides it a look regularly.

  39. Very nice post. I just stumbled upon your blog and wanted to say that I’ve really enjoyed browsing your blog posts. In any case I’ll be subscribing to your feed and I hope you write again soon!

  40. Thanks on your marvelous posting! I really enjoyed reading it, you happen to be a great author.I will make certain to bookmark your blog and definitely will come back sometime soon. I want to encourage yourself to continue your great posts, have a nice evening!

  41. Good post. I learn one thing more challenging on totally different blogs everyday. It should always be stimulating to learn content from other writers and observe a little bit something from their store. I’d desire to make use of some with the content material on my weblog whether or not you don’t mind. Natually I’ll give you a link in your internet blog. Thanks for sharing.

  42. hentai3d says:

    I conceive this site holds very superb written written content articles.

  43. What i don’t realize is actually how you’re no longer really a lot more well-favored than you may be now. You’re so intelligent. You understand thus significantly in the case of this matter, produced me in my opinion imagine it from so many various angles. Its like women and men don’t seem to be involved unless it is one thing to accomplish with Lady gaga! Your own stuffs nice. All the time deal with it up!

  44. Good – I should certainly pronounce, impressed with your website. I had no trouble navigating through all tabs and related information ended up being truly simple to do to access. I recently found what I hoped for before you know it at all. Quite unusual. Is likely to appreciate it for those who add forums or something, site theme . a tones way for your client to communicate. Nice task.

  45. Joker123 says:

    Hi, i think that i saw you visited my site thus i came to “return the favor”.I am trying to find things to improve my website!I suppose its ok to use a few of your ideas!!

  46. so much excellent info on here, : D.

  47. Macauwin138 says:

    Today, I went to the beach front with my kids. I found a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear. She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

  48. Macauwin138 says:

    Hi! I know this is kinda off topic but I was wondering if you knew where I could find a captcha plugin for my comment form? I’m using the same blog platform as yours and I’m having trouble finding one? Thanks a lot!

  49. Jackpot168 says:

    Great post. I am facing a couple of these problems.

  50. This web site is known as a stroll-by way of for all the info you wanted about this and didn’t know who to ask. Glimpse here, and you’ll positively discover it.

  51. Hello.This post was extremely motivating, particularly because I was searching for thoughts on this issue last Saturday.

  52. okeplay777 says:

    I just could not depart your website before suggesting that I actually enjoyed the standard info a person provide for your visitors? Is going to be back often in order to check up on new posts

  53. aladdin138 says:

    Simply wanna input on few general things, The website style is perfect, the written content is very superb. “The sun sets without thy assistance.” by The Talmud.

  54. mantap168 says:

    Your place is valueble for me. Thanks!…

  55. gateio says:

    I have read your article carefully and I agree with you very much. This has provided a great help for my thesis writing, and I will seriously improve it. However, I don’t know much about a certain place. Can you help me?

Leave a Reply

Your email address will not be published. Required fields are marked *