Hello, Pi: Coding Zero to Hero

Поделиться
HTML-код
  • Опубликовано: 26 окт 2024

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

  • @HAGSLAB
    @HAGSLAB 2 года назад +38

    This is a great starting point for anyone wanting to tinker with the RPi and electronics. I once developed a commercial product that was basically 75% this. A bit more software and a relay instead of an LED (well, in addition to the LED (...actually 3)) and a Raspberry Pi Zero. Point is: tinker, tinker, tinker.

    • @jonshouse1
      @jonshouse1 2 года назад +6

      This is a poor starting point for anyone wanting to tinker with an RPI. It breeds an unneeded dependency on proprietary tools to do what is a simple job that can be done without Windows, VS or a PC.

    • @HAGSLAB
      @HAGSLAB 2 года назад +5

      @@jonshouse1 There are usually multiple ways of doing things. This is one way. VS Code is open source and works on Microsoft, Mac and Linux. VSCodium is also an option if you don't want any of the telemetry stuff in the MS binaries.

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

      @@jonshouse1 why is it unneeded.
      The world depends on proprietary and non.
      Learning both is better than one.

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

      @@HAGSLAB VS is not open source in any meaningful way, otherwise it would be in Debian free and would install on my Linux/Sparc machine... I've met modern programmers who simply are unable to cope without their pet IDE of preference. The entire VS/Xcode/Android studio ecosystem breeds people who are unable to cope with real programming and have poor differentiation between features of the operating system, IDE and compiler. I think it is very poor way to learn anything to use any IDE, but I find Microsoft's efforts to push their environment on students distasteful and probably in the long term harmful to open source.

    • @HAGSLAB
      @HAGSLAB 2 года назад +6

      ​@@jonshouse1 Haha, I find you pushing your environment more distasteful than Microsoft giving away free and open source software my dude.

  • @aaronperl
    @aaronperl 2 года назад +45

    I like that you did an example in C, as opposed to every other tutorial that uses Python

  • @SandorPipei
    @SandorPipei 2 года назад +87

    2:12 It is a good habit to use a resistor to limit the current passing thru the LED. :) You can calculate using Ohms law. R = (Vsup - Vf) / Imax. Ex (3.3 - 1.7) / 20mA = 80 Ohms (100)
    Vsup = Suplpy voltage
    Vf = forward voltage of the LED
    Imax = maximum current thru the LED
    To be safe, we have to take in account also the maximum current draw of the RPI's GPIO pin = 16mA (3.3 - 1.7) / 16mA = 100 Ohm

    • @medicallyunexplainedsymptoms
      @medicallyunexplainedsymptoms 2 года назад +12

      And modern LEDs are bright enough with only 1 - 2 mA. For a green LED (3.3 - 2)/0.002 = 650R would be about right. I'd use 620R.
      The longer reason is that LEDs are non-linear devices. Once the voltage across it is enough to turn the LED on, its differential resistance is very low - that means a small change in LED voltage leads to a large change in current. Essentially it's like putting a short-circuit on the Pi's output, as it's trying to supply amps (not mA) to make up the voltage difference between its output and the LED's voltage. The Pi will have some limit, but it's never good to rely on that. Similarly, LEDs shouldn't be paralleled with only a single resistor - one resistor per LED is needed.

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

      this comment and replies rock

    • @SyBernot
      @SyBernot 2 года назад +7

      @@medicallyunexplainedsymptoms You also need to provide for component failure. LED's will typically fail open but on rare occasion they will fail short and with nowhere to shed that load your 3.3v rail goes to ground and stays there until, well, it doesn't. No resistor is like rubbing that lamp eventually that blue smoke genie is going to grant your wish for a new Pi, but not in the way you expected.

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

      Without any calculations, a 220 or 330 ohm resistor would provide some current limiting and also light up a red or green led.

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

      If you connect the LED in wired and logic (activating the internal pull-up resistor or the pin has an external pullup) you can omit the external resistor, but is dangerous to rely on the internal pullup resistor. The output in this case will be inverted.

  • @bobdunstan5457
    @bobdunstan5457 2 года назад +11

    Pretty cool using VS for the UI on the PC and running the actual compiler/linker/debugger on the PI itself. Am looking forward to using it in the near future! Thanks Dave.

  • @appliedengineering4001
    @appliedengineering4001 2 года назад +17

    As what other have commented about in this video. If you are gonna hook an LED directly to the pins of the Pi. I would recommend that you use a BLUE LED for this, why? Because a blue LED had a forward drop of about 3 volts, were as red and green LED's have a forward drop of about 1.7 volts. Having that extra forward drop help reduce load stress on the IO pin as well as the LED.

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

      Yo mamma has a forward drop.

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

      Yep, blue, white, or modern emerald green. White LEDs are blue LEDs with yellow phosphor, and emerald green ones also have Vf around 3V.

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

      Either that or 2 LEDs in series

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

    I gave this a shot with my son today. We were curious about the vscode setup. It took us a few hours and eventually we had a successful blinking light. Thanks Dave. Very useful. Would be good if you had some more pi content. Always good to learn new things.

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

    For all those questioning a resistor... a PI3 can only output 16 mA max on each pin. The default setting is 8 mA. I haven't used wiring pi myself so I don't know if you can change the output level through that or not. I do know if you get into the low level memory functions it can be changed that way and I think it is possible with a few other GPIO libraries.

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

    Dave, Thanks for an excellent presentation of C in VSCode for RaspberryPi.
    You rekindle joy!

  • @poppycobb7028
    @poppycobb7028 2 года назад +6

    Dave, this was great timing. My grandson and I are just starting out learning how to program the raspberry pi’s to notify me when the mail has been delivered to my mail box at the street. We thought your intro training was excellent as we both understood the programming and wrote our first working c code program on our new RPI’s. We each have PI 4 Mod B 8 gigs. Hope you build on the training you have started with the PI C programming. Tyler & Poppy Cobb

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

      What a wholesome comment and project for you and your grandson. I wish you both good luck!

  • @richardtwyning
    @richardtwyning 2 года назад +19

    The LED did look like it was being overdriven! 😉 I would definitely calculate a reasonable resistor to limit it. It'll prolong the life of the LED 🙂

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

      Yes. Thar setup put the LED at risk, but more significantly, it also put the RasPi itself at risk. One really needs resistors (roughly minimum of 1k) to make the GPIO safe on the RasPi...

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

      @@BGBTech doesn't need to be that high! 100-300 would do nicely

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

      @@danman32 For an LED those would probably work OK (since the LED adds its own voltage drop). For things like switches or signal loads, I usually prefer 1k to be safe. This limit each pin to around 3.3mA; though granted, the rated limit is 16mA, safer to stay short of the limits.

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

    Hey Dave. Just wanted to say that I am finding myself a little more in your videos. Thanks for stepping out of the comfort zone and doing this.

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

    The reason you don't need a resistor with LED is because the output of the PI is aready current limited. The forward voltage will stop at the point its current limited. However the GPIO will go dead at some point. I know this because we have some card access reading systems set up like this and after a couple of months the GPIO fails on every one and also affects some of the other non used gpio. So I recommend using a resistor to ensure longevity.

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

      This is a problem is that software "engineering" is not like every other type of engineering. This is the hardware equivalent of checking that an object is not null before using it. For a noob it'll probably work fine without the check 99.999% of the time and the rest of the time, someone just turns it off and on again. But if its possible for it to be null then you need to deal with it. Unfortunately, in hardware land, once the GPIO output transistor is buggered a reset doesn't fix it - Its permanently buggered. So rather than relying on a current limit that is there probably for static protections rather than direct abuse - far easier to just make sure you're only ever drawing a couple of mA from the pins. And, just like software guys, hardware guys all ignore their own standards and occasionally make something do something because they can. So I2C with 3.3V and 5V parts is an example, each pin has a clamp diode to prevent external pulling the pin above 3.3V but with I2C some idiot will have pullups going to 5V, we rely on the fact that as they are 10k the idiot diodes will clamp at 3.3 and only a fraction of a mA will flow because its 10k but thats well within the 10mA limit. So there you go, don't do it but if you do know the limits.

  • @jackielinde7568
    @jackielinde7568 2 года назад +6

    RE: No resistor for an LED running on 3.3 volts. If memory serves me correctly, diodes do weird things to either current and/or voltage, so the resistor was to act as a load to control the current/voltage to keep the LED from burning itself out. But, since you're not running that LED for more than a few seconds, I think you're safe. Then again, there's an answer to this, but it would mean dusting off and cracking open books from Radio Shack that I haven't opened since the late 80's. (Yes, I was THAT NERD/DORK/DWEEB from high school that was reading books on electronics back in high school. Why yes, I also wore mismatched clothing with high wasted pants straight from Revenge of the Nerds, too. Why do you keep asking these questions?) Short answer is I'm not gonna, because that's work and I have coding in C# to learn.

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

      It's going to depend on the LED. For anything more than test purposes I would recommend doing the math, and you need to know the specs of the specific LED. Even among the same size, brand, and design the specs will change based on color. I haven't burned out many LEDs at 3.3v that I remember, I usually default to a something like 60R on 3.3v if I'm not going to figure it out first. But on 5V an average LED will go out immediately (not a few seconds).

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

      It should have a resistor even though the logic voltage is similar to the LED forward voltage. The logic output will current limit but it is not a good idea to rely on that as it makes the chip run hot if greater than 20ma. The current the LED will draw depends on its forward voltage drop (differs by color and type) and other factors such as temperature. It is bad practice to run any LED without a series resistor. 330R is about correct, min value should be 150R, for a high brightness LED upto 4k7 will be ok.

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

      @@kyleolson8977 60R at 3.2v=53ma, way off. 150R = 20ma is about the smallest safe value with 330R = 10ma being more sensible for most indicator LEDs, personally I would use 1k = 3.2ma for high brightness LED types.

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

    So awesome! Thanks for the complete introduction. Now I can use VSC, C, and the debugger!

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

    that breakout cable is AWESOME

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

    Yeah, I'd like to see you do more Pi programming stuff. I'd like to see projects that have a physical result, like a weather station or remote camera stuff. Also it would be cool to see some audio related stuff like maybe an amplifier or something.

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

    I saw you try to run "cls" in the BASH terminal, and here I thought I was the only one to make that mistake! Apparently CMD and BASH syntax is similar enough to confuse our brains.

  • @greg4367
    @greg4367 2 года назад +8

    Thanks Dave, just finished installing and compiling. This was great. Could I interest you in explaining how to get control of the tty/uart in a pi-C program. It would be a great help and open many doors. Keep up the great work. BTW, enjoyed your book, explained a bit about me to me. I'm sure I'm not the only one.

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

      Nope, not the only one. Trying to prototype some serial code. It seems to be easier in baremetal than Linux. Even Python struggles.

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

    Very cool, I learned about remote development using VSCode. I'm one of those old grey bearded UNIX guys who wouldn't generally use VSCode for this type of stuff, but I do have it for development on Windows so I will have to experiment here.
    This reminds me of one of the most useful features of an old '70s minicomputer, the wait LED. You could tell a lot about how your system was performing by how this LED blinked, or didn't. Now we need someone to implement a wait LED in the Raspberry Pi Linux kernel, probably in cpu_idle just before (turn off LED) and after (turn on LED) it calls cpu_relax.

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

    Great callout for Jeff Geerling! I love both of the channels. Jeff (because he's local to me and has great content) and Dave (because he has great content). Keep up the awesome work, Dave!

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

    You have per GPIO pin and total GPIO pin current limits on the Pi. Depending on how much your LED draws you can put some strain on both the Pi and the LED.

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

    Hi Dave. This opens up a whole world of useful stuff for the PI. I'd like to see software allowing the creation of a web server that serves input/output status and analogue I/O values from the PI. It would be useful for remote monitoring of the home environment etc.

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

      I've considered actually building myself a bunch of NAS machines using PI's just because you can trivially get external I/O in and out of them. Then things like measuring temperature, turning fans on/off, etc, is literally trivial. Or, maybe even just make an LED chaser for the front panel who's speed tells you some important parameter. :)

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

    Seeing the Apple II in the background was awesome. That was my first computer back in the day.

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

    Super cool video today Dave. Now I gotta go find my old pi and start playing since you've done all the legwork of setting it up!

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

    I've been going through Paul McQuarter's course on Python on Pi but I would also like to program in C on the Pi.
    For Paul's course I have the Pi sunfounder kit which besides devices and sensors, comes with a breadboard and breakout cable

  • @makethingsbetter
    @makethingsbetter 2 года назад +5

    Great video, keep them coming. I saw a video on “The Coding Train” channel where we programmed graphics using fractal cos and sin functions, with an old 8 bit unit. Worth a look. But I do wonder how far graphically we could push the simple Pi unit. A video on creating a simple high res image, without an image file, would be great. I’m r coding your face onto the screen only using asci symbols. Fun 🤩

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

    Excellent video Dave! This kind of thing is great! more, more!

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

    Definitely would love to see more on working with the Pi in Code! More on microcontrollers in Code as well would be great :)

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

    I hope you cover more complex embedded topics in the future. I do really enjoy your content.

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

    3.3V for a green led may be fine, but red leds will generally have lower forward voltage... they will scream if no serie resistor is used!! (but I personally always use resistors :D )

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

      I've burned out a board with static from my hand connecting with a signal wire that had no resistor. Also got a lot of line on the noise.
      You'll save yourself a lot of headaches with a good resistor placement.

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

      Resistor please, proper respect for I/O pin current limits.

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

    FYI -- in Raspberry OS Bullseye no longer supports WiringPi. It has been deprecated because the original author (Gordon) has decided to stop supporting it because of various reasons PiGPIO is the alleged replacement. If you're programming in Python, you can use the python3-gpiozero package (installed by default). Also, I believe you meant "Remote Development" in the video description. "Remove Development" seems a bit counterproductive...lol

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

    Would love to see more like this, been interested in learning the coding side of electronics but never got around to it.

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

    Dude! I wish this had a few more search key words as you covered exactly what I was looking for. For the life of me I could not figure out where to put that -lwiringPi ! I also hadn't thought about running as admin/sudo. Thanks!!!!

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

    I can't resist leaving a comment about that poor LED getting blasted with whatever the current limit is on the GPIO pin

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

      id be more worried about trashing my 50$ pi board

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

    Great video Dave! I assume the gpio pins have an internal current limiting resistor since you didn’t add one and it didn’t burn up the LED?

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

      I am sure I had to use one as it was different value to arduino`s.

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

    Old, grey bearded wizard! Thanks Dave. From another old grey bearded wizard, 1000's miles from home. I have a Pi with me but had to use it for something else. Great tutorial, looking forward for more.

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

    As others has already pointed out, wiringPi is deprecated. There is only a 32bit version available, so it wont install on a 64bit version of raspberry OS, debian etc.

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

    Yes you need a resistor on the LED, otherwise you're relying on the current limit of the output pin >:-0 . Ideally you'd be switching a transistor that would drive the LED.

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

      Pi can source and sink around 18ma, unless the LED is from the 1960s I don't think it needs the transistor! Yes, it should have a series resistor.

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

      @@jonshouse1 A quick google suggests it can only supply 50mA to all GPIO so for up to three LEDs you'll probably get away without a transistor. I'm an electronic engineer, I'd always use one :-)

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

      @@nialstewart8263 I wont sweat total power dissipation for one LED on a board. would not use one unless needed as it is another thing to source, more PCB space and another component for some Chinese factory to inappropriately substitute and cause subtle issues the moment I stop looking ;-) just saying ....

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

      @@jonshouse1 Yes fair enough. Too much for software people to get their heads around too. 🤣

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

      @jonhouse1 id never buy anythi g you designed

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

    Hey Dave! Love the videos you do here! I'm super interested in low level stuff on the Pi without an operating system (and actually saw someone do something similar to this video, but in Rust without an operating system). Do you think you could do something like that in the future?

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

    3:34 - Dave you should know this by now, but RUclips AUDIENCE IS NEVER EXPERT SUPERVISION. You can't claim us bunch of jokers and trolls as being "experts" at anything other than being jokers and trolls.

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

      @♜ᴛᴇʟᴇɢʀᴀᴍ+𝟏 𝟐 𝟔 𝟐 𝟗 𝟓 𝟓 𝟖 𝟗 𝟒 𝟎 Fuck off you bot! You will not be scamming me or anyone else here!

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

    Thanks!
    As for topics: More on Visual Studio using "C", "C++", and Rust. Modular programming. Risc-V coding.
    They say less is more but in programming More is More.
    Plus, I plagiarize -- as do all programmers and musicians.

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

    Don't use hardware-specific crap like WiringPi, just use libgpiod, the generic Linux GPIO library that works on any hardware. That way when someone wants to run this code on a different board because there are no Raspberry Pis to be had anywhere they don't have to rewrite the entire thing for no good reason. Plus, the sysfs interface that WiringPi still appears to use has been marked deprecated in the kernel for a while.
    Even the dead link to the main git repo says "look for an alternative - as in use another GPIO library"

    • @Dawsatek22
      @Dawsatek22 2 месяца назад

      there is now a fork

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

    Very nice video. Nice to see everything "up front", nothing happening behind the curtain. I'm surprised a current limiting resistor isn't needed, but hey if it works it works. The VS looks very nice (lots nicer than the old vs6). BTW I have an autistic son with some significant intellectual limitations but he's making his way in the world ok (with some help from the state).

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

    I've been developing for 30 years, and I hate to say because I've done it commercially, I'm really comfortable with GUI development in Windows, but unfortunately not in Linux, so I'd love to see something about that.

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

      Lazarus and Free Pascal, RAD IDE even on Pi, including a baremetal version Ultibo.

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

    "Ah maaan, there's JSON and build environment, I don't wanna know about all of that." Forth programmer: "I don't wanna know about all of that either and, look, the LED's already blinking!" 👍

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

    Oh thank goodness. I half expected you to put Windows on it, to blink the LED. ;)

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

    Thanks Dave, as always excellent stuff. Stuart from Melbourne AU

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

    Got a like just for "So you don't have to try it both ways!". Made me think about a video *I* am planning to share my "forever" lamp and my intention is to make it simple enough so anyone can do it and one of the things I'm going to be mentioning is "If it doesn't work, stick it in the other way!". Also, in case anyone's interested, it's a project for a night lamp. I have a love for things that last a long time and my original intention was to make something like that using a whole gaggle of tritium lights. But instead I made an "emergency" light that has a "glow" mode with a trimmer pot to adjust the glow mode level and then a momentary pushbutton with like a 100 ohm ballast (much MUCH brighter than the 10K-100K trimmer ballast. I gave an order of magnitude there because I'm old and can't recall and I'm not tearing it apart for a comment only to hot melt glue it back together). Honestly, if I hadn't had it sit on my night stand for 2.5 years glowing away every single night, I wouldn't have believed it. I knew the runtime was going to be stupid, I mean, I did the math before I built it for a couple of different drive currents, but turns out I was able to turn that trimmer pot to it's highest resistance and it was still bright enough to read a written page up close so long as you have night adapted eyes. I was expecting to have to drive it WAY harder to be that bright. We're talking close to the light of a glow stick in cooler temperatures, but it runs for literally years on a single set of 3 AA cells. As far as electronics projects go, it's literally as simple as you can get and honestly, I've made much more technically impressive toys as gifts (I made "blinkie" for my ex boss/friend I used to jockey code for. It was a pic 12c508A microcontroller that blinked an LED at random using a linear feedback shift register. It ran for about 4 to 6 months on a set of cells with the low clock rate I ran it at. It even came with ASM source on printed paper.! :P It was because he always joked "Micro's aren't good for anything but blinking lights". Lol! And yes, he loved it.), but seeing something that runs for literally years like that, entirely on its own, it *feels* like alien technology. So, I'll do the next one under the camera. :P

  • @juanmacias5922
    @juanmacias5922 2 года назад +6

    C is such a beautiful language! I just started learning it for fun. :D Yes, more programming!

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

      Er, C is ugly, been using it for 40 years, I prefer almost any other language on Pi's.

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

      @@alwayscensored6871 lol agree to disagree, I personally think go, and python are ugly lol

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

    I'm sure someone will say in the comments, " why are you using a Pi for flashing that LED?!" "just use an LM555 timer!" :P

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

      why even use a 555, two transistors is fine..anyway, using a pi to blink an led is not doing electronics

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

    It is good to see an actual software engineer posting content on how to program stuff for a pi. There is other content, but the real tragedy is the scattered quality of it all. I do see your content as a fair comparison to Jeff Gerling's videos. If not for any other reason than to give newbies some more guidance since us older dev's can totally just make things work using some pretty janky setups while mumbling "I will just use vim and a command line."

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

      I'm a hardware guy learning Pi coding, Dave is software guy learning hardware. From the comments lots of hardware guys screaming about the lack of a resistor.

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

      @@alwayscensored6871 Totally. I am a software guy, too. But I did land a job in hardware from having arduino and pi builds as a hobby. I will say this, the chances of breaking a pi is MUCH greater than the chances of breaking an arduino. And I have seen the basics you learn with these systems ignored and people accidentally fry $4000 equipment. So do follow the wisdom dropped by the electrical engineers.

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

      @@mattwestover8014 Pi's don't survive much if you stick 12v into the 5V, whoops. Mind you I still have a model A running after 10 years, B+s running 24/7 for 8? Nothing beats them for the price. Still learning Pico's, just got my first PicoWs.

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

      @@alwayscensored6871 Picos are great. So are the Arduino Nano Connect rp2040 if you need a little more functionality (i.e. they come with a built-in ESP32 module for wifi, and more on board sensors than the usual basic microcontrollers on the market. Dave has a lot of useful content for ESP32 boards, too. He managed to inspire me to buy a few. Maybe one day he will mess with a nano connect since it is more comparable to the hardware his LED driver was designed to use.

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

    I must admit to jealousy when you pulled out that wera screwdriver set! sweeeet.

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

    Thanks, did not need this, did it years ago BUT, if I was starting today Thanks This is Perfect. 😄

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

    Has DAVE gt an Apple Watch??? What a world we live in 🤣🤣🤣🤣 Oh and sudo apt update && sudo apt upgrade

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

    I actually use my Raspberry Pi inside the guts of an old BBC Micro. I removed all of the original electronics, connected the original BBC Micro keyboard to dedicated USB convertor (manufactured by Tynemouth Software), and then connected that USB directly to the Pi. After "hot wiring" one of the keyboard LEDs to the new (and cold running) TDK PSU, the machine even reproduces the BBC's start-up beeps. Other mods included modifying the rear ports to HDMI, USB and Serial, and blanking off the unused connectors with matt-black plastic plugs. What's amazed me about this is just how nicely a single box computer (with an HP monitor sat on top) actually works! In fact, when I'm not working - it's pretty much my main computer.

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

      Erm... by any chance selling any of the removed electronics?

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

      @@MechanicaMenace Sorry - they're all carefully packaged in anti-static bags and stored in the loft. Another bit of bad news is that Tyneside no longer sell the fantastic little BBC Micro to USB convertor they used to make. A real shame that, as I would have loved to have made another BBC-PI Micro for my little nephew!

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

      i thought he had open sourced that converter?

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

      @@lindafader9618 Ta for the heads up!

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

    Brilliant vid Dave! Thankyou!

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

    I mean this as sincerely as I do platonically... I love you, man!

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

    Here's an idea way outside the box but would be useful to some, Build a Pi that could be "tap" into modbus RTU (serial) communication and output it. Would be a great debugging tool for an older protocol still used a lot in industrial applications, but no one is building tools for it anymore.

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

    Dave - Love your videos.. I'm definitely interested in more videos like this. I have been into computers since the late 70s, and had a TRS80 COCO first.. Did some assembly on the COCO and then the PC in the DOS days, but assembly got very complicated for an uneducated hacker like me when protected mode was introduced, so I moved on to Turbo Pascal. I ended up on the administration and networking side of the house though, so while I was off doing Active Directory, Exchange, and Cisco networking, my programming skills froze in time. I did a fair amount of VB6 though, and have been doing the microcontroller/IOT thing since the original "Basic Stamp" in the early 90s. The fascinating thing to me here was the integration of VS with the PI.. I've got maybe a dozen PIs around the house doing various things, but had NO IDEA I could use VS to do the development, especially remotely! I would love some more basics on the development environments and some of the modern tools. Thanks a lot for taking the time to make these videos - They are very interesting!!

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

    I found a course on udemy where we use the datasheets and program directly to the registers. A lot of lines of code to blink a light, but baremetal programming like that is fun.

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

    Nice tutorial! Now its time to wire up my Pi to a car horn and make myself a homemade alarm clock suitable for a heavy sleeper.

  • @ophawku
    @ophawku Год назад

    Dave, Love the AMG Wheel-Table, Dale

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

    I love a great Apple Pi...erm, Raspberry I mean. Great vid Dave. Made me chortle but as ever, what you said actually works...Love it.

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

    @Dave's Garage - As a REAL green Pi/Arduino/ESP32 user who's fallen head over heals in the IoT & home automation - home assistant end of the aforementioned three.
    I'm about to embark on a lighting quest (RGB+CCT) that may or may not involve hyper HDR(SK6812's @5v for the 65" LG OLED).
    I would be really interested in watching you create some interesting effects, say... for [my] shelving that has 12 separate strips (60LEDs/m - 24LEDs/strip) of WS2812b's illuminating each cubicle of shelf.
    And then somehow tie that in with something like Home Assistant...?
    (GOD I Hope I got the nomenclature right with my vernacular! Lol!)
    Been subbed over a year and dropping likes to all I've watched, and just LOVE you content!
    Even the short series in which you were tinkering with the most high-powered computer available in my birth year 1977 🙃😉
    Never stop brother!
    I just love learning, and have been a full blown nerd for so long, it WASN'T cool when I was first called one 😁😅

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

    As an old "bare metal" embedded system engineer, I dislike any "high level" abstraction between the programmer and the hardware. That, and no programmable interrupt handling !

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

    A similar project using UPsquared bored will be even more fun!

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

    Excellent and useful. Would love to see more on PI.

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

    This is definitely going to be great for my students at work with robotics. Have to give it a whirl on a pi Zero W

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

    Dave, I don't seem to have the build json file you show. Was that one you created or was it installed as part of the process you went through?

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

    my dusty 3B+ will have a new purpose ! thanks a lot for the motivation

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

    Dave=mvp

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

    For people advising the resistor. I don't know about the Pi, but Arduino has a resistor embedded in its circuits for uses like this, so it's ok to plug the led directly in some cases.

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

      AVRs (the microcontroller on the Arduinos) don't have embedded resistors, and Arduinos don't have external ones. The output pins have short-circuit protection, which isn't the same thing. LEDs need resistors to limit current (or be driven with a constant-current source).

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

      @@medicallyunexplainedsymptoms Hi, I responded but YT deleted my comment. I'm a noob with just a couple of projects put together with help of tutorials. I don't have much knowledge of electronics, but I was referring to the pull up resistors and I read somewhere it's ok to use then.

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

      @@ShuAbLe The pullups do not current limit the GPIO. The gate still needs a series resistor. On most processors the internal pullups are referred to as "weak pullups" as they tend to be around 100k ohms, they are not current limiting the transistors sinking or sourcing current from the GPIO line... It is a little confusing, but makes more sense if you see it drawn in individual transistor/resistors.

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

      Pi's have current limits on GPIO pins but it is still good practice to use external resistor.

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

    I would like to see a video on restoring an SD card back to full size. Using diskpart and SD Formatter is the only way that has worked for me, perhaps there is a program that will restore an SD cards capacity without using didkpart but I haven't found it.

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

    Got a bunch of pi's in the drawer, what I would like to see is maybe more hardware setup,examples of boxes vs implementations.

  • @Sgt_Bill_T_Co
    @Sgt_Bill_T_Co Год назад

    When I downloaded the app and it opened, it looked noting like yours and nor could I make look similar, thus I returned to my usual VNC to link them together.

  • @GTB-yu2be
    @GTB-yu2be 2 года назад

    You know the beginning of this video described exactly what I have done with my Raspberry Pi😏

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

    This video is definitely getting put in browser tool bar. I use my PI4 several times a week to surf the web and practice my CLI, but now I will get into more play time with it. Wish you did the code in VIM on the pi. Now I have to learn VS Code. lol.

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

      It's just a text editor. Shell in and edit in vi or whatever editor you like. build/link with gcc from the command line and learn gdb while you're there. It's not hard. No GUI or mouse needed.

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

      @@TEDodd Thanx

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

    2:35 - I suppose you're getting a kickback for these, and, if so, I understand. Yet also, since you're "mostly in this for the subs and likes", I thought I'd point out that Adafruit is a great source for stuff like this, too... And as far as I can tell, a much more ethical option to link to. :)

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

    I know I would like to see more videos on programming the pi.

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

    The thing that takes this from merely good to great is that you wrote it in C.

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

    I think I have several PIs and mini pcs laying around waiting for me to spend some time with it..... any idea where I can find time? I really enjoyed this video it motivates me to change a few priorities and start tinkering. Big thanks.

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

    Do you teach your kids programming? If so, do you have any tips as to where to start? I’m not a coder myself but I would like them to learn for their future.

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

    Dave, have you tried this with the latest (9/6/2022) 32 bit bullseye version? sudo apt install wiringpi fails with a package not found error.

  • @SmittyHalibut
    @SmittyHalibut 2 года назад +5

    I’ve been programming in C since the 90s, and have historically been in the printf() school of debugging. I’d love to learn more about “real debugging” like VSCode and gdb offer. Do you already have a “Getting Started” series on that? If not, I’d love to see one.

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

      I agree, Visual Studio's debugging looks so cool, but feels unapproachable. If you feel like kicking the crust of this t..d I think many of us would benefit.

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

      Well C does typically need a debugger when things go wrong.

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

    You probably get away with not using a resistor for the LED because the LED voltage drop is close to the Pi's 3.3v but not using one is not a good idea for the LED or Pi as you may still be exceeding safe current for both.

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

    I'm a bit confused - where does 'true' come from ? It is not part of standard C. Neither of the includes look likely to contribute it either.

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

    I don't currently have a pi but was curious. Looking at the code, did you need to include ? I didn't notice any standard input/output.

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

    Useful video thanks Dave !

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

    My VS screen doesn't look like yours, and I can't quite get to where you edit the ssh config. Obviously, I haven't been able to try anything beyond that point.

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

    But how do you make it run the program automatically when you boot the raspberry pi WITHOUT the connection from the remote pc running visual studio?

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

    5:38 "I read of course and accept the agreement" 😂

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

    I plan on doing a PI project...python app on the PI that sends data via bluetooth (with the livrary PyBluez ?) to an android app on my phone (done with Android Studio)...maybe this could be a topic suggestion. thanks for the videos

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

    I prefer visual basic blinking led :))

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

    I like the idea of Dave doing this work in GCC on Linux; fun hacking using bits that would have been a big no no during some of the time he was at Microsoft.

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

    10:23, Dave typed the windows version in terminal. :p

  • @Random_user-sz7nk
    @Random_user-sz7nk Год назад

    I felt personally attacked by that intro 😂

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

    of course im gonna comment on an unlisted video
    FIRST

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

      I C what you did there.

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

    Dave, I'd love to see an Arduino video!

  • @michaelguerrero7232
    @michaelguerrero7232 Год назад

    It is my understanding that wiringpi has been depreciated and is no longer supported... Just a heads up... But great vid none the less. Ots what i came across when i was writing code for a variable speed pwm fan (argon mini hat fan) that was speed controlled based on cpu temp.

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

    Having trouble with building. When I choose 'run build task', it cannot find the tasks.json file. I found a command, 'tasks: configure task', which opened a file on my local system instead of the Pi and the build command cannot access that.

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

      On closer inspection of Dave's video, I can see that, along with the source code, there are additional files in the demo folder, one of which is the 'tasks.json file. I don't have that and it's not clear to me from Dave's video how it got created. Oh, and when I run 'build task', the output shown in the terminal window shows that it's calling /usr/bin/cpp instead of /usr/bin/g++. How do I fix these issues?