Raspberry Pi Robotics #1: GPIO Control

Поделиться
HTML-код
  • Опубликовано: 23 июл 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 RUclips channel at: / explainingcomputers
    You may also enjoy my other channel at: / explainingthefuture

Комментарии • 606

  • @Musicman-50
    @Musicman-50 2 года назад +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  2 года назад +4

      This is great to hear. :)

    • @RainbowSheep_was_taken
      @RainbowSheep_was_taken 2 года назад +3

      family members never understand the value of 4 flashing leds

    • @Musicman-50
      @Musicman-50 2 года назад +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 2 года назад

      @@Musicman-50 lol

  • @StevenBennett74
    @StevenBennett74 5 лет назад +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 9 лет назад +25

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

  • @kameroncross1753
    @kameroncross1753 4 года назад +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.

  • @abeomer86
    @abeomer86 6 лет назад +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!

  • @liamo907
    @liamo907 8 лет назад +14

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

  • @zuber1995
    @zuber1995 8 лет назад +11

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

  • @baooutube
    @baooutube 9 лет назад +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.

  • @breaky011
    @breaky011 4 года назад +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.

  • @bengray55
    @bengray55 5 лет назад +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

  • @jerryrichard4994
    @jerryrichard4994 7 лет назад +136

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

  • @fredberg2760
    @fredberg2760 5 лет назад +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!

  • @resrussia
    @resrussia 8 лет назад +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.

  • @JanosTerroz
    @JanosTerroz 9 лет назад +2

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

  • @BradWaltz
    @BradWaltz 4 года назад +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 2 года назад

      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 2 года назад

      @Frederick Terrence instablaster =)

  • @michaelmyers4484
    @michaelmyers4484 5 лет назад +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 👌👍

  • @dillardc81
    @dillardc81 5 лет назад +4

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

  • @JasonWhittle1
    @JasonWhittle1 7 лет назад

    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.

  • @SuperSpuddo
    @SuperSpuddo 7 лет назад

    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.

  • @katiestokes7393
    @katiestokes7393 6 лет назад +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!

  • @LynxChan
    @LynxChan 2 года назад +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 Год назад

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

  • @jamessakobie9085
    @jamessakobie9085 10 лет назад +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 10 лет назад +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.

  • @TheNeonbuffalo
    @TheNeonbuffalo 7 лет назад +4

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

  • @sapphiretigress1
    @sapphiretigress1 8 лет назад +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  8 лет назад

      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.

  • @sumedhghodke8916
    @sumedhghodke8916 6 лет назад +13

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

  • @ZeppelinPass
    @ZeppelinPass 3 года назад +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  3 года назад +1

      Thanks for this, and for the sub.

    • @ZeppelinPass
      @ZeppelinPass 3 года назад

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

  • @vixenmurrberry5412
    @vixenmurrberry5412 5 лет назад +12

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

  • @AngeloGi
    @AngeloGi 10 лет назад +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!

  • @redshop1234
    @redshop1234 5 лет назад +2

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

  • @saindst
    @saindst 8 лет назад +2

    Best tutorial I have seen in a long time tbh

  • @beradical100
    @beradical100 4 года назад +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.

  • @Megatron666
    @Megatron666 7 лет назад

    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  7 лет назад

      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: ruclips.net/video/NAl-ULEattw/видео.html

  • @mikes3540
    @mikes3540 6 лет назад

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

    • @ExplainingComputers
      @ExplainingComputers  6 лет назад

      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): ruclips.net/video/NAl-ULEattw/видео.html

  • @vedropomoev4836
    @vedropomoev4836 6 лет назад

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

  • @edwardwhite8253
    @edwardwhite8253 6 лет назад +2

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

  • @mbdilaver
    @mbdilaver 9 лет назад

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

  • @kerwinfernandes9583
    @kerwinfernandes9583 7 лет назад +2

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

  • @PJ1004
    @PJ1004 9 лет назад

    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  9 лет назад +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 8 лет назад

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

  • @5698max
    @5698max 3 года назад

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

  • @MrMoonpie001
    @MrMoonpie001 10 лет назад +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  10 лет назад +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.

  • @BogieWogieHesse
    @BogieWogieHesse 7 лет назад +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!

  • @GuitarreroDaniel
    @GuitarreroDaniel 2 года назад +2

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

  • @ottoomen5076
    @ottoomen5076 7 лет назад

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

  • @sourcekings
    @sourcekings 4 года назад +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 6 лет назад +1

    Excellent presentation and simple to understand!

  • @hugoperozo4895
    @hugoperozo4895 4 года назад +1

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

  • @oxynetz
    @oxynetz 3 года назад +1

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

  • @GadeEmbossed
    @GadeEmbossed 6 лет назад +1

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

  • @vasquezg86
    @vasquezg86 7 лет назад +1

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

  • @anon77_65
    @anon77_65 4 года назад +2

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

  • @mygreenhousediary5947
    @mygreenhousediary5947 3 года назад

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

  • @shwi9883
    @shwi9883 2 года назад

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

    • @ExplainingComputers
      @ExplainingComputers  2 года назад

      Great to hear! :) You may be interested in my Pi GPIO inputs video: ruclips.net/video/NAl-ULEattw/видео.html

  • @tinkmarshino
    @tinkmarshino 5 лет назад +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  5 лет назад +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 RUclips comments that many older people have taken up an interest in SBCs. You may enjoy this video: ruclips.net/video/NAl-ULEattw/видео.html

    • @tinkmarshino
      @tinkmarshino 5 лет назад +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 5 лет назад

      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 5 лет назад

      Age is just a state of mind.

  • @mukeshsah1374
    @mukeshsah1374 6 лет назад +1

    interesting tutorial bcoz of ur amazing speaking way...

  • @princemireku1337
    @princemireku1337 5 лет назад +1

    Another subscriber you just earned for such a wonderful teaching

  • @arunsandhu777
    @arunsandhu777 5 лет назад +1

    Awesome way of explaining things...

  • @haroonnaseem1
    @haroonnaseem1 6 лет назад +1

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

  • @franciscalderbank8623
    @franciscalderbank8623 4 года назад +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.

  • @yoericktv9610
    @yoericktv9610 5 лет назад +3

    Fantastic presentation. Thank you.

  • @ahoj113
    @ahoj113 2 года назад +1

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

  • @mishota_8437
    @mishota_8437 5 лет назад +1

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

  • @baptistesauvage1223
    @baptistesauvage1223 8 лет назад +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  8 лет назад +1

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

  • @timclingenpeel7791
    @timclingenpeel7791 4 года назад +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.

  • @anonymous08almanza54
    @anonymous08almanza54 7 лет назад +1

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

  • @michaelthill8707
    @michaelthill8707 8 лет назад

    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  8 лет назад

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

  • @user-sw1lw8jn3e
    @user-sw1lw8jn3e 5 лет назад

    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  5 лет назад

      Thanks. You may also like my similar video on GPIO inputs: ruclips.net/video/NAl-ULEattw/видео.html

  • @petworld8023
    @petworld8023 4 года назад

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

  • @Noah71555
    @Noah71555 2 года назад +1

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

  • @airthrow
    @airthrow 7 лет назад +1

    as a programming beginner this is SUPER helpful, thsnks!

  • @zemtech4325
    @zemtech4325 8 лет назад

    You are extremely good. Please don't stop

  • @jetray5914
    @jetray5914 4 года назад +2

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

    • @ExplainingComputers
      @ExplainingComputers  4 года назад +2

      Excellent! You may also like the one I did on using GPIO inputs: ruclips.net/video/NAl-ULEattw/видео.html

  • @paganone
    @paganone 9 лет назад

    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  9 лет назад

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

  • @goodstufff8164
    @goodstufff8164 7 лет назад +1

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

    • @ExplainingComputers
      @ExplainingComputers  7 лет назад

      Thanks for the sub. You may also find useful my video on the 'output' side of things: ruclips.net/video/NAl-ULEattw/видео.html

  • @WhyITravel.
    @WhyITravel. 7 лет назад +2

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

  • @thilacthilacsan7352
    @thilacthilacsan7352 9 лет назад +1

    I really like watching your videos

  • @umairgillani699
    @umairgillani699 5 лет назад +2

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

    • @ExplainingComputers
      @ExplainingComputers  5 лет назад

      There are several on this channel -- eg: ruclips.net/video/NAl-ULEattw/видео.html

  • @MikeNHOC
    @MikeNHOC 9 лет назад

    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..

  • @juliohdez5327
    @juliohdez5327 5 лет назад +1

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

  • @Intercontinentalist
    @Intercontinentalist 4 года назад +1

    Such a brilliant tutorial. Subscribed

  • @mchristofas
    @mchristofas 9 лет назад

    Very Nice Production work!

  • @norbac
    @norbac 7 лет назад

    I love this dude! Not only is he an excellent instructor but funny as well--and he reminds me of John Lennon too!!

  • @TradingGuide
    @TradingGuide 7 лет назад +1

    Great to the point tutorial. Thank you :)

  • @jjofishh
    @jjofishh 10 лет назад

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

    • @ExplainingComputers
      @ExplainingComputers  10 лет назад

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

  • @wanders11
    @wanders11 9 лет назад

    Well done, sir! I have been using RPi in a Chemical Instrumentation class for a few years. I have wanted to use RUclips 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!

  • @romneysmith4912
    @romneysmith4912 3 года назад +1

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

  • @RISHI12ist
    @RISHI12ist 9 лет назад

    Great tuturial. Great Job!

  • @abello4f1
    @abello4f1 9 лет назад

    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!

  • @RalphCopley
    @RalphCopley 6 лет назад +1

    Thank you this video was most helpful.

  • @samindakularathne
    @samindakularathne 8 лет назад +3

    Awesome tutorial :) Thanks

  • @HarveyMushman
    @HarveyMushman 6 лет назад +1

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

  • @srinivasancheenu1908
    @srinivasancheenu1908 4 года назад +1

    Well explained...and interesting..

  • @harshansingh4822
    @harshansingh4822 3 года назад +1

    his tutorials are very good
    keep it up sir.

  • @rezabavarikor8060
    @rezabavarikor8060 4 года назад +1

    That was amazing basic steps.Thanks alot.🤗🤗🤗

  • @pourkin
    @pourkin 9 лет назад

    Excellent tutorial...thanks

  • @jeanpierretoxe5717
    @jeanpierretoxe5717 6 лет назад +1

    Thank you for this very good video

  • @jesusreignonhigh6732
    @jesusreignonhigh6732 6 лет назад +1

    I wonder if the code could be optimized for event-driven style programming.

  • @tbdwoods
    @tbdwoods 7 лет назад

    very helpful and easy to understand thank you

  • @alexandersantillan1316
    @alexandersantillan1316 10 лет назад

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

  • @khaledzentany2012
    @khaledzentany2012 8 лет назад

    very clear explanation. Thank you so much.