Raspberry Pi Robotics #1: GPIO Control

Sdílet
Vložit
  • čas přidán 25. 07. 2024
  • In this video I explain how to connect LEDs to a Raspberry Pi's general purpose input-output (GPIO) pins, and how to write Python code to turn them on and off. My next video then builds on this foundation to control a motorized robot, and can be found here: • Raspberry Pi Robotics ...
    This video assumes some knowledge covered in my "Setting Up a Raspberry Pi" video: • Setting Up a Raspberry Pi
    Note that this tutorial will work with both a Raspberry Pi Model B, as well as the newer Model B+ (on which I will do a video shortly!).
    You can find the wiring diagrams, as well as links for the components used in my Raspberry Pi robotics videos here: explainingcomputers.com/rasp_p...
    More videos on computing and related topics can be found on my CZcams channel at: / explainingcomputers
    You may also enjoy my other channel at: / explainingthefuture

Komentáře • 606

  • @Musicman-50
    @Musicman-50 Před 3 lety +28

    I'm 70 years old, and I just started learning Python to use in some home automation projects.
    I've been watching your videos for years now, but I just wanted to say how very well done this entry level tutorial was.
    The two basic examples were so perfect for those like me just starting out.
    Here I am 70 and felt like I was like a kid with my Raspberry Pi flashing 4 LEDs (Yes I went extreme). And couldn't wait to show it off to other family members. They unfortunately didn't really see the true value in what I had just created, but they never see that in any of my gadget creations. LoL
    Anyway Thank You so very much for this most Excellent Tutorial. You just made my day brighter.

    • @ExplainingComputers
      @ExplainingComputers  Před 3 lety +4

      This is great to hear. :)

    • @RainbowSheep_was_taken
      @RainbowSheep_was_taken Před 2 lety +3

      family members never understand the value of 4 flashing leds

    • @Musicman-50
      @Musicman-50 Před 2 lety +2

      @@RainbowSheep_was_taken at true. My daughter is like "Dad what's the big deal of 4 flashing lights?". I started to explain the fact that everything is run by tiny circuits like this. Response was her eyes rolled=Error- does not computer.. LoL

    • @RainbowSheep_was_taken
      @RainbowSheep_was_taken Před 2 lety

      @@Musicman-50 lol

  • @StevenBennett74
    @StevenBennett74 Před 5 lety +13

    Love the way you teach. Thank you for breaking it down so I can learn what's happening rather than copying someone else and not really know what's going on.

  • @reardelt
    @reardelt Před 9 lety +25

    This is actually so cool. I was always wanted to learn how to use software to control hardware.

  • @abeomer86
    @abeomer86 Před 6 lety +2

    I use C# to develop for Pi, but Python really finds it's way of impressing any programmer, especially when such professional instructor presents it. Thank you, great man!

  • @zuber1995
    @zuber1995 Před 8 lety +11

    That was really well explained, one of the best tutorials ive seen.

  • @kameroncross1753
    @kameroncross1753 Před 4 lety +2

    Very in depth and made easy to understand. I really appreciate how you don't just put the commands in instead you explain what they are and why unlike many other youtubers.

  • @fredberg2760
    @fredberg2760 Před 5 lety +1

    Really excellent. Other videos / explanations don't convey information this clearly and they are heaps of fun to watch. KEEP UP the great work!

  • @michaelmyers4484
    @michaelmyers4484 Před 5 lety +6

    35 years, man. If people kept their stuff in order and functioning like you do, we would have a lot less waste on the planet 👌👍

  • @liamo907
    @liamo907 Před 8 lety +14

    have to say, you're a fantastic teacher. Keep up the good work!

  • @jerryrichard4994
    @jerryrichard4994 Před 7 lety +136

    You are an amazing teacher, very easy to follow your video, you don,t make it difficult compare to other people's videos

  • @bengray55
    @bengray55 Před 5 lety +8

    Fantastic.
    I'm completely new to ok, and managed to follow the video, had a few hiccups with capital letters giving me syntax errors, but muddled through.
    And! Made a traffic light setup too.
    Thank you so much for this

  • @SuperSpuddo
    @SuperSpuddo Před 7 lety

    Chris I have been follwing your channel for some time. Your videos are well produced, concise, clear, and comprehensive. You are a great teacher. Thank you so much for your endeavours. I look foward to each new video you produce.

  • @LynxChan
    @LynxChan Před 2 lety +1

    I'm a rank beginner at all of this, never programmed, never made a circuit and I cannot state enough how satisfying it was watching that little LED flash on and off. Thank you!

    • @vicmac3513
      @vicmac3513 Před rokem

      How has your skills evolved during the past 10 months? Have you built your custom mechanical keyboard yet?

  • @breaky011
    @breaky011 Před 4 lety +1

    As a fellow educator, nice work. This made things very easy to understand and not only covered some good parts of coding but also helped immensely with very basic setup of initial hardware which is appreciated.

  • @baooutube
    @baooutube Před 9 lety +34

    You just earned a subscriber! I understood everything you said. Great video! (I am 9 years old and am using my dad's account with his permission in his presence). I now program in Java but your video made me go nuts on Python.

  • @JanosTerroz
    @JanosTerroz Před 9 lety +2

    Fantastic Job. i was tinkering with the idea of getting a PI and your style of instruction has sold me on it. Thanks.

  • @TheNeonbuffalo
    @TheNeonbuffalo Před 7 lety +4

    Great video!!!! Really simple and thank you for explaining every line, it help immensely

  • @resrussia
    @resrussia Před 8 lety +4

    An excellent tutorial on using the Pi and GPIO. I reviewed most of the videos on covering this topic and your video tied with one video other clarity and conciseness. I would recommend this tutorial to anyone interested in using the Pi and GPIO.

  • @AngeloGi
    @AngeloGi Před 10 lety +3

    Thanks a lot for that! I always lacked the basic knowledge of this stuff, and it's good to get a nice taste of them!

  • @sumedhghodke8916
    @sumedhghodke8916 Před 6 lety +13

    You r like BUDDHA who explains difficult stuff with complete ease. You and your tutoring is great.

  • @sapphiretigress1
    @sapphiretigress1 Před 8 lety +6

    learning python as my first language, and just found out about raspberri pi...then found your videos. Mind blown. :D Always thought robotics was out of reach, but now i'm ridiculously excited

    • @ExplainingComputers
      @ExplainingComputers  Před 8 lety

      Wonderful! :) Do checkout my fairly recent video on Raspberry Pi GPIO inputs. There is a quite a bit of Python coding in that. And I will soon do some more video on the robotics stuff.

  • @JasonWhittle1
    @JasonWhittle1 Před 7 lety

    I liked how you first created a program to print on and off, then manipulated that to control the motor. It made it really easy for me to understand. Good job.

  • @dillardc81
    @dillardc81 Před 5 lety +4

    Thanks for this. I've had my pi laying around for years and am finally getting into it again.

  • @jamessakobie9085
    @jamessakobie9085 Před 10 lety +2

    Well done my friend! I finally got a project to work after watching your video. It is extremely educational and well put together. i'm looking forward to another project. Thank's for your time.

  • @n.mishev
    @n.mishev Před 10 lety +1

    Please do more of these videos as i think that a lot of people (including me) will learn many things and are going to be inspired in the process.

  • @BradWaltz
    @BradWaltz Před 4 lety +4

    Been dabbling in code for years in and off and never really got stuck in. This is the first time everything has lined up and made sense, thank you so much

    • @frederickterrence3076
      @frederickterrence3076 Před 2 lety

      i know im asking the wrong place but does anybody know a method to log back into an Instagram account?
      I stupidly forgot the login password. I would appreciate any assistance you can offer me.

    • @korbyncarson1924
      @korbyncarson1924 Před 2 lety

      @Frederick Terrence instablaster =)

  • @oxynetz
    @oxynetz Před 3 lety +1

    Your gift for instructing is very unique... Amazingly easy to follow. Nice

  • @redshop1234
    @redshop1234 Před 5 lety +2

    Thanks for a great tutorial! Very easy to follow, and quite informative. Much appreciated.

  • @GuitarreroDaniel
    @GuitarreroDaniel Před 2 lety +2

    This is the only GPIO that I could understand. Thank you for this!

  • @katiestokes7393
    @katiestokes7393 Před 6 lety +3

    Best programming video I’ve ever seen! I was working on trying to do this for hours! I finally figured it out because of you! Thank you so much!

  • @ZeppelinPass
    @ZeppelinPass Před 3 lety +1

    I have been considering getting a RPi for a few weeks and looked at a number of beginners tutorials.
    Hands down you are the best at explaining what you are doing.
    Put it this way, I now understand what 'sudo' means.
    These basic pieces of info are paramount to learning the language.
    Many thanks, your newest subscriber.
    ZP

    • @ExplainingComputers
      @ExplainingComputers  Před 3 lety +1

      Thanks for this, and for the sub.

    • @ZeppelinPass
      @ZeppelinPass Před 3 lety

      @@ExplainingComputers Thanks for the amazingly educational content! :-)

  • @kerwinfernandes9583
    @kerwinfernandes9583 Před 7 lety +2

    Really very well explained. God Bless!! (waiting for my pi 3 to arrive )

  • @beradical100
    @beradical100 Před 4 lety +2

    I agree with many others with the notion that you are an excellent teacher, I enjoy all of your content and have learned a great deal of quite useful infomation as well. With my first comment I would like to thank you very much for your densely informative content.

  • @mikes3540
    @mikes3540 Před 6 lety

    Inspiring and accessible.
    Just finished duplicating this video at home, I was that motivated. And now empowered. Much appreciated!

    • @ExplainingComputers
      @ExplainingComputers  Před 6 lety

      Excellent -- great to hear that you followed this through! You may also like the follow-up on using Raspberry Pi inputs (one of my own favourites): czcams.com/video/NAl-ULEattw/video.html

  • @tinkmarshino
    @tinkmarshino Před 5 lety +11

    ooooh Chris.. this is the old man again... the deeper I get into your old videos the more confident I am that I can still do this.. even with my diminishing mental abilities I think I can! you have given new life to an old man... this is like the old days eh.. with the trs 80's and pre IBM machines... The days when everything was possible it was just a matter of getting the coding right.. I am excited I can even afford to do this too.. it is always hard on a fixed income to afford to do new things.. plus it seems like nothing is new in old age.. but old things are exciting at times... thanks Chris.. you will probably not ever see this since the vid is so old..But I do thank you..

    • @ExplainingComputers
      @ExplainingComputers  Před 5 lety +1

      I have seen this! :) And you are right, experimenting with single board computers has the same feel to how computing used to be. Learning how to set them up and make them do stuff is very rewarding. And I know from my CZcams comments that many older people have taken up an interest in SBCs. You may enjoy this video: czcams.com/video/NAl-ULEattw/video.html

    • @tinkmarshino
      @tinkmarshino Před 5 lety +2

      thanks my friend after I watch your Rasp pi 3 b+ vid (I am watching on my other screen) I will watch this one...

    • @rickhunt3183
      @rickhunt3183 Před 5 lety

      Don’t put limitations on yourself. If you can understand these basic steps you can build upon it, and nothing will be out of reach. Think of python as just an expanded version of the old ms basic and you’ll do fine.

    • @rock3tcatU233
      @rock3tcatU233 Před 5 lety

      Age is just a state of mind.

  • @vedropomoev4836
    @vedropomoev4836 Před 6 lety

    Thank you for the very clear explanation without blah-blah as the most videos on CZcams.

  • @edwardwhite8253
    @edwardwhite8253 Před 6 lety +2

    what a marvelous video, a very crystal clear instructions. excellent job my good sir.

  • @mbdilaver
    @mbdilaver Před 9 lety

    Best RPi gpio video on CZcams. Keep up the good work please!

  • @Megatron666
    @Megatron666 Před 7 lety

    Thank you for posting this. Such a clear description. I've been learning Python for the last month so I can start playing with my Raspberry Pi and this is the first time that I've got the code to do something in "the real world". As an adult who has been interested in robotics all his life but never got into it, until recently, this is a momentous occasion for me and I just wanted to share that with you.

    • @ExplainingComputers
      @ExplainingComputers  Před 7 lety

      Thanks for sharing -- I too found it amazing the first time I managed to interface programming and electronics. It changes how you relate to computing! You may find interesting my second two Pi robotics videos, and also this one looking at GPIO inputs: czcams.com/video/NAl-ULEattw/video.html

  • @BogieWogieHesse
    @BogieWogieHesse Před 7 lety +1

    Hey Chris! Really great stuff. You got me interested in Raspberry Pi and all the things that you can do with it. So being a totally new to the coding world and just a little bit of experience with electronics, i ordered RasPi and now using your videos as a source to my new projects. You are the Governor! Keep up the excellent work!

  • @MrMoonpie001
    @MrMoonpie001 Před 10 lety +3

    Chris, thank you for the great video and the detail involved, I am not only looking for information I am also looking for education. I think many folks may expect too much out of the Raspberry Pi, I think it is just a starting point for greater things to come. I would rather learn this information in the manner you teach.
    Always grateful for your time and effort, some of your videos are very time consuming to make, you do a great job!
    Moonpie

    • @ExplainingComputers
      @ExplainingComputers  Před 10 lety +2

      Thanks for your kind feedback as always. :) I agree that the Raspberry Pi is primarily a learning tool, and it is that spirit that I have made videos about it. I find the Pi fascinating as a bridge between electronics and programming. In many ways, while computers are now incredibly powerful and useful -- eg as video production and communications tools -- they are less interesting than they were 20+ years ago when many users programmed them and understood them as more than magical boxes.

  • @vixenmurrberry5412
    @vixenmurrberry5412 Před 5 lety +12

    your the best starter/noobs teacher I've been able to refer to

  • @saindst
    @saindst Před 8 lety +2

    Best tutorial I have seen in a long time tbh

  • @5698max
    @5698max Před 3 lety

    I am an absolute beginner and this video has helped me a lot. Great explanation, thank you!

  • @hugoperozo4895
    @hugoperozo4895 Před 4 lety +1

    Excellent video. You ROCK! Well done and THANK YOU for taking the time and for making a difference.

  • @GadeEmbossed
    @GadeEmbossed Před 6 lety +1

    Why have I overlooked the abilities of the pi besides retro gaming? Thank you great tutorial!

  • @Noah71555
    @Noah71555 Před 2 lety +1

    Raspbian has really come a long way since the first raspberry pi, pretty amazing

  • @arunsandhu777
    @arunsandhu777 Před 5 lety +1

    Awesome way of explaining things...

  • @timclingenpeel7791
    @timclingenpeel7791 Před 4 lety +1

    I have my robot built - now I will have to study your videos so I can learn to code. Thank you for all the information you provide in your videos.

  • @vasquezg86
    @vasquezg86 Před 7 lety +1

    Great Vid for this beginner. This has really helped me out. Thanks!!!

  • @sourcekings
    @sourcekings Před 4 lety +2

    While watching I've learned python my main thing was wondering how everything lined up but you explained it well thank you.

  • @jameszah
    @jameszah Před 6 lety +1

    Excellent presentation and simple to understand!

  • @mishota_8437
    @mishota_8437 Před 5 lety +1

    Amazing! It was easy to follow trough and i learned something!

  • @PJ1004
    @PJ1004 Před 9 lety

    I've just bought my first Raspberry Pi which was going to be entirely for computing use but having watched your video, I have now got myself a breadboard, resistors, LEDs, and have managed to get this LED tutorial working really well.
    Thanks for the excellent and clear instructions!

    • @ExplainingComputers
      @ExplainingComputers  Před 9 lety +1

      PJ1004 Excellent! There are so many things you can do with a Raspberry Pi. And the more you experiment, the more possibilities present themselves. :)

    • @bighands69
      @bighands69 Před 8 lety

      +PJ1004
      You have just entered the world of robotics, automation and control systems. I hope you continue with your adventure.

  • @ottoomen5076
    @ottoomen5076 Před 7 lety

    This is the raspberry pi video everyone is looking for! Thanks. I wish someone would create the same video programming with mathematica.

  • @mygreenhousediary5947
    @mygreenhousediary5947 Před 3 lety

    Excellent teacher, thankyou so much for sharing your knowledge in such an easy to follow and concise way 👍

  • @paganone
    @paganone Před 9 lety

    Thank you, Mr. Barnatt! Great video, I got quite a a sense of accomplishment once I completed this project. On to the next one!

    • @ExplainingComputers
      @ExplainingComputers  Před 9 lety

      paganone Excellent! I remember being happy when the LEDs came on myself! :)

  • @michaelthill8707
    @michaelthill8707 Před 8 lety

    This is fantastic! Really great explanation with marvellous use of screen shots, photos and diagrams. THANK YOU!!! I'm a high school teacher in Sydney, Australia and will be directing my students directly to this. They'll love it. Keep up your great work.

    • @ExplainingComputers
      @ExplainingComputers  Před 8 lety

      +Michael Thill Many thanks. In a few weeks I'll be posting a follow-up video about using the GPIO pin as inputs.

  • @jetray5914
    @jetray5914 Před 4 lety +2

    You have no idea how long I've been looking for this video without knowing it

    • @ExplainingComputers
      @ExplainingComputers  Před 4 lety +2

      Excellent! You may also like the one I did on using GPIO inputs: czcams.com/video/NAl-ULEattw/video.html

  • @goodstufff8164
    @goodstufff8164 Před 7 lety +1

    Great Video! I was looking for a quick intro to the software side with RPi.GPIO, this was perfect. New sub!

    • @ExplainingComputers
      @ExplainingComputers  Před 7 lety

      Thanks for the sub. You may also find useful my video on the 'output' side of things: czcams.com/video/NAl-ULEattw/video.html

  • @mukeshsah1374
    @mukeshsah1374 Před 6 lety +1

    interesting tutorial bcoz of ur amazing speaking way...

  • @yoericktv9610
    @yoericktv9610 Před 5 lety +3

    Fantastic presentation. Thank you.

  • @anon77_65
    @anon77_65 Před 4 lety +2

    Excellent videos - I'm a big fan. It would be amazing if you did the basics of electricity leading up to electrical engineering

  • @MikeNHOC
    @MikeNHOC Před 9 lety

    I Enjoyed this video very much! I am getting a Rpi B+ and parts kit as a late Christmas gift. It will have LEDs, motors, switches and buttons etc. I am looking forward to getting it and experimenting with the examples you showed in the video.. Thank you again for making it..

  • @baptistesauvage1223
    @baptistesauvage1223 Před 8 lety +1

    Great video, it was my first coding with a raspberry pi, you made it very clear and very easy to understand: GREAT job!!

    • @ExplainingComputers
      @ExplainingComputers  Před 8 lety +1

      +Baptiste Sauvage Excellent. Look out for my GPIO inputs video fairly soon now. :)

  • @franciscalderbank8623
    @franciscalderbank8623 Před 4 lety +1

    Another great tutorial completed. The only snag I incorporated was because I used 470 ohm resistors and not the 220 ohm as stated. Once I changed the resistors to the correct value given "hey presto" the light show commenced. I assumed that the resistance value was too high and would not allow the signal form the Raspberrypi to output and complete the circuit.

  • @anonymous08almanza54
    @anonymous08almanza54 Před 7 lety +1

    thank you and you are very an amazing teacher and you clearly explanation.

  • @shwi9883
    @shwi9883 Před 2 lety

    A very clear explanation. Worked on my first attempt. You have renewed my interest in raspi. Thankyou

    • @ExplainingComputers
      @ExplainingComputers  Před 2 lety

      Great to hear! :) You may be interested in my Pi GPIO inputs video: czcams.com/video/NAl-ULEattw/video.html

  • @romneysmith4912
    @romneysmith4912 Před 3 lety +1

    How can 3 flashing LEDs be so exciting. Explained in a very clear and understandable manner. Thanks

  • @princemireku1337
    @princemireku1337 Před 5 lety +1

    Another subscriber you just earned for such a wonderful teaching

  • @user-sw1lw8jn3e
    @user-sw1lw8jn3e Před 5 lety

    Congratulation. You're a briliant constructor. The clearest and more understandable video i've ever seen. I'm gonna use it in my class.

    • @ExplainingComputers
      @ExplainingComputers  Před 5 lety

      Thanks. You may also like my similar video on GPIO inputs: czcams.com/video/NAl-ULEattw/video.html

  • @haroonnaseem1
    @haroonnaseem1 Před 6 lety +1

    Amazing Teacher... i hope i will meet you one day... LOVE FROM PAKISTAN

  • @petworld8023
    @petworld8023 Před 4 lety

    Since so many I was searching for a teacher in robotics and finally found great one

  • @airthrow
    @airthrow Před 7 lety +1

    as a programming beginner this is SUPER helpful, thsnks!

  • @ahoj113
    @ahoj113 Před 2 lety +1

    I can’t believe a Pi can do this much! Awesome video :)

  • @RalphCopley
    @RalphCopley Před 6 lety +1

    Thank you this video was most helpful.

  • @umairgillani699
    @umairgillani699 Před 5 lety +2

    Good basic tutorial. Please come up with more tutorials like these.

    • @ExplainingComputers
      @ExplainingComputers  Před 5 lety

      There are several on this channel -- eg: czcams.com/video/NAl-ULEattw/video.html

  • @TradingGuide
    @TradingGuide Před 7 lety +1

    Great to the point tutorial. Thank you :)

  • @thilacthilacsan7352
    @thilacthilacsan7352 Před 9 lety +1

    I really like watching your videos

  • @srinivasancheenu1908
    @srinivasancheenu1908 Před 4 lety +1

    Well explained...and interesting..

  • @jjofishh
    @jjofishh Před 10 lety

    Great video really clear, this also works for a b+ module in case your wondering. Thanks.

    • @ExplainingComputers
      @ExplainingComputers  Před 10 lety

      Thanks for your kind feedback.I tried it with the Model B+ only this week, only with some more LEDs! Raspberry Pi Model B+ :)

  • @WhyITravel.
    @WhyITravel. Před 7 lety +2

    Just Awesome.. Perfect for beginners in Electronics like me. :D

  • @zemtech4325
    @zemtech4325 Před 8 lety

    You are extremely good. Please don't stop

  • @abello4f1
    @abello4f1 Před 9 lety

    Fantastic! Easy setup and concise instructions. You mashed up some of my current interests all at once, raspberry pi, Python programming, and LEDs. Looks fun. Now do it for 1000 LEDs and try to get them to spell flash, "Like a Boss." Hahaha Thanks!

  • @HarveyMushman
    @HarveyMushman Před 6 lety +1

    Thank you very much sir!
    This was very easy to understand.
    Best regards,
    Harvey

  • @mchristofas
    @mchristofas Před 9 lety

    Very Nice Production work!

  • @RISHI12ist
    @RISHI12ist Před 9 lety

    Great tuturial. Great Job!

  • @alexandersantillan1316
    @alexandersantillan1316 Před 10 lety

    Thank you so much! This video helped out a lot.

  • @jeanpierretoxe5717
    @jeanpierretoxe5717 Před 6 lety +1

    Thank you for this very good video

  • @basilsunnyalukka4491
    @basilsunnyalukka4491 Před 7 lety +3

    Thank u .really cool video.

  • @khaledzentany2012
    @khaledzentany2012 Před 8 lety

    very clear explanation. Thank you so much.

  • @tutorjoes
    @tutorjoes Před 9 lety

    Very Very Nice Sir For Your Tutorial

  • @wanders11
    @wanders11 Před 9 lety

    Well done, sir! I have been using RPi in a Chemical Instrumentation class for a few years. I have wanted to use CZcams videos for students, but the dozens of "light up an LED" videos all bring in unrelated content (GMAIL BOX? Really?) that complicate the focus of the lesson. You do a good job of both explaining each required step (importing the time library) and NOT adding spurious factors (as cool as they may be) as distracting bling. Good job!

  • @Intercontinentalist
    @Intercontinentalist Před 4 lety +1

    Such a brilliant tutorial. Subscribed

  • @KhalidUneeb
    @KhalidUneeb Před 8 lety +1

    Extremely helpful

  • @samindakularathne
    @samindakularathne Před 8 lety +3

    Awesome tutorial :) Thanks

  • @juliohdez5327
    @juliohdez5327 Před 5 lety +1

    I learnt in 15 minutes what I did not do in a book of 500 pages, thank you!

  • @gavincoan8006
    @gavincoan8006 Před 9 lety

    Finally!!! I understand. Thank you much :)

  • @tbdwoods
    @tbdwoods Před 7 lety

    very helpful and easy to understand thank you

  • @docfoot316
    @docfoot316 Před 8 lety

    Just new to all this at 60 ,very helpful so thanks very much.

    • @ExplainingComputers
      @ExplainingComputers  Před 8 lety

      No problem. Look out for my video on using GPIO inputs a week on Sunday. :)