Can ChatGPT Write An Arduino Sketch From A Simple Description

Поділитися
Вставка
  • Опубліковано 26 вер 2024
  • Can ChatGPT Write An Arduino Sketch From A Simple Description
    I asked ChatGPT to write an Arduino sketch to create a Larson Scanner using the PWM pins.
    Openai, Coding, Chatgpt Tutorial, Programming, Esp32, Chatgpt Explained, Electronics, How To Use Chat Gpt, Chat Gpt Tutorial, Software Engineering
    www.pcbway.com/ Get 5 boards in about a week for $27!
    *************************************************************************
    Please help support this channel at NO COST TO YOU. If you shop on *Amazon, please use this link: amzn.to/3706t6c *
    *I will get a small commission and it costs you nothing. *
    *************************************************************************
    HEY YOU ABOUT TO POST SOMETHING STUPID:
    Yes, I know my hands are large/fat. It's because of a heart condition I suffer from called Congestive Heart Failure. Here's a link to some information about CHF: cle.clinic/2Td...
    One of the symptoms is that it causes fluid retention, mostly in the hands, feet/ankles, and face..
    -------------------------------------------------------------------------------------------------------------------
    Support learnelectronics:
    Amazon Store:
    If you are shopping for electronic components, test gear or consumables please consider visiting my Amazon shop @ amazon.com/shop/learnelectronics
    Patreon:
    Please check out www.patreon.com/learnelectronics and pledge a dollar if you can. It will go a long way to keeping the channel alive. It costs a bit of money to buy all the items and produce these videos. Your help is appreciated.
    Paypal:
    Or....if you'd like to send a one-time donation you can use this link: paypal.me/learnelectronics
    ---------------------------------------------------------------------------------------------------------------------
    Gear I use:
    Multimeter: OWON B33+ amzn.to/3UkTJOo
    Oscilloscope: KIPRIM DS1202 amzn.to/3gfJGMN
    Signal generator: Junctek JDS8080 shorturl.at/ehTZ1
    Component Tester: T7 Multifunction amzn.to/3AYY03v
    Soldering Station: Sealody ???????

КОМЕНТАРІ • 85

  • @petedavis7970
    @petedavis7970 Рік тому +22

    I'm a software engineer. I've been using ChatGPT for a while (I got an early subscription). I use it in my job every day, a LOT. It's enormously useful. Not just writing code. I mean, it's darn good at writing basic code (the kind of stuff I find pretty tedious). It does really well with small bits (not writing large programs, so much). But I also use it for manipulating data, analyzing code, documenting code, explaining code (just paste it in and ask, "What does this code do?"), finding bugs in code, writing unit tests, etc.
    The first day I used it at work, it paid for itself in the time I saved. Can't imagine working without it.

    • @jeff15
      @jeff15 Рік тому +1

      I need to get into this. !!! Lol . Do you use the paid subscription version ? Any advice ? Thanks

    • @petedavis7970
      @petedavis7970 Рік тому +1

      @@jeff15 Yeah, I do paid subscription. Totally worth it. Pays for itself several times over every single day I work. I also use Copilot. some people use it more than ChatGPT, but I find ChatGPT to be more useful and I definitely use it more than Copilot. Still love and use Copilot, though. Kind of complementary functionality, really...
      A lot of people think it's more limited than it is. You just need to learn how to write the right kinds of prompts, and that's just a skill you have to develop. Over time, the more you use it, the better you get at knowing how to ask for what you want.

    • @TheTubejunky
      @TheTubejunky Рік тому +2

      This comment was made by CHATGPT
      Nothing to see here move on and look at the next AD....

    • @maxmuster7003
      @maxmuster7003 Рік тому

      Sounds good.Thx.

  • @sinjhguddu4974
    @sinjhguddu4974 Рік тому +6

    ChatGPT is scaringly fascinating. Dronebot did a beautiful tutorial on it recently. Thank you for this wonderful experiment. Stay well you all.

  • @quantumlab9130
    @quantumlab9130 Рік тому +3

    As someone loves hardware but hates software this is great, atleast for writing simple codes like this one

  • @jimb032
    @jimb032 Рік тому +4

    The amazing part is that the ChatGPT system was available.
    Dave's Garage did a great tutorial on how to train it and ask it properly.
    But as advanced and as great as it is, there is not substitute for code review and experience.

  • @superslammer
    @superslammer Рік тому +2

    Its a very useful tool and not only doing things like this but learning how to ask it for what you want and then learning from what it has output, and even correcting it when its wrong. I've been using the hell out of this and I've been learning a lot about programming languages I never thought I'd be able to learn.

  • @daveharwood2843
    @daveharwood2843 Рік тому

    I wanted to give this a try, so I did! I was also suitably impressed. When it came to controlling the speed, I asked ...
    "Can you add a speed control via potentiometer?" ... and it DID!

  • @WatchesTrainsAndRockets
    @WatchesTrainsAndRockets Рік тому +1

    I have to amend my previous comment. I just got around to actually setting up the Arduino and the sensor and testing the code. What chatterbox wrote WOULD have been better than me if the device sent an analog signal and IF that had been connected to an analog pin. Neither was true. When I pointed that out, it modified the code to (correctly) treat the input as a PWM signal. It also pointed out that I could display the actual pulse width in the serial monitor for purposes of tuning the threshold. Being out of practice and just too lazy to look it up, I asked ChatGPT to add that to the code. It did so by adding print statements that displayed the width by RE-READING the input. I had to point out that that was a bad idea. Yes, it can and does generate code. The overall logic is correct but there are rookie mistakes hiding in the details. It reminds me of my days mentoring the new hires just out of school. They knew the mechanics and were eager to do the job but they often missed the subtleties that differentiate success from failure.

  • @weerobot
    @weerobot Рік тому +6

    I did that Similar...Chat GPT can't Solder Yet...lol...Future going to be Weird ...

    • @davem3325
      @davem3325 Рік тому +1

      It also cant do component selection, and purchasing!

  • @CTCTraining1
    @CTCTraining1 Рік тому +1

    I liked how it left you just a little bit to do to complete the project so that one might think that it wasn’t making us totally redundant ... but I suspect that will be tuneable in time.

  • @Schyttehometech
    @Schyttehometech Рік тому +1

    Its a super efficient learning tool.
    Used it to learn som ESPhome programming, and instead of searching for hours on google to find excamples, I could just ask, and ChatGPT explanined i easy to understand english, what the code did and what possibilities there was.
    1000x times more efficient.

  • @OnePotMeals
    @OnePotMeals Рік тому +2

    Pretty impressive! This is only the beginning - great experiment, thank you!

  • @philtuckerm0dpk212
    @philtuckerm0dpk212 Рік тому +2

    WOW!! as a teacher in the field of Micro's i'm truly worried about what i just watched. This is going to start a real debate that maybe needs to happen sooner rather than latter. Thanks for sharing Paul.

    • @Merlin_Shaw
      @Merlin_Shaw Рік тому +2

      Debate are nice to get folks talking about it, but this can't be regulated. If they make these types of A.I. illegal to use, there will for sure be underground options available that folks will pay for. Linus Tech Tips has a great segment on this being here to stay no matter how much people object or try to fight it. The best thing to teach your students will be to learn to adapt and embrace a part of it as the bot will always need someone to verify the code just like he had to make a few tweaks. There will always be a need for a professional subject matter expert so that the output is looked through and checked before being made public.

  • @ivovass195
    @ivovass195 Рік тому +3

    This chatgpt as coding helper is neat, definitely made me want to retry some projects I snoozed due to my insufficient coding abilities. Sometimes It can be quite wrong but with some tweaks can be helpful

    • @tigrafrog
      @tigrafrog Рік тому

      Not a best idea. if you will not fully understand code that thing "generated" (but in fact just combine someone else's code) you will have bugs / unintended functionality.

    • @ivovass195
      @ivovass195 Рік тому +1

      @@tigrafrog Yes, definitely not a good idea if one has no understanding of code, but for someone with an average understanding of how things work can venture and try more complex programs or at least get a starting point. The nice thing is you can get the chatgpt to change stuff if it fails at start like we saw in the video

  • @pow9606
    @pow9606 Рік тому +4

    Now ask it to do it without using a delay statement and use timers instead. 😁

  • @Tarakian1999
    @Tarakian1999 Рік тому +6

    Since I am a programmer, let’s not tell my boss.

  • @davestorr6764
    @davestorr6764 Рік тому +1

    My favourite video yet, mind blowing actually isn’t it 👍

  • @DIYDaveOK
    @DIYDaveOK Рік тому

    Hey glad to see a video from you. Hope your Thursday and days going forward are better than last night. Have been concerned about you since your post, hate that you're dealing with so much. Appreciate your content.

  • @naboulsikhalid7763
    @naboulsikhalid7763 Рік тому

    I had the same feeling at first glance, after I experiment it with very different tasks, and consequently saving a lot of time and given a precise answer(pls verify always), I am very very happy, I become more efficient, productive and intelligent. This is the tool that civilization needs to go much further, because human brain shows some slow in processing info and finding solution. Civilization has just took off with speed of sound. embrace yourself for what is coming. I am happy any way. Thank you

  • @shagreobe
    @shagreobe Рік тому

    Been seeing chatgpt everywhere...might be time to play with it a bit

  • @WatchesTrainsAndRockets
    @WatchesTrainsAndRockets Рік тому +6

    I was a little skeptical about this as it could have the code for a Larson Scanner buried in its database and just spit it back out. To test this theory, I have it write code to use a proximity sensor and to light one of three LEDs based on whether an object was detected, if detected, beyond a certain range, or lastly, within that range. Darn thing did it and better than I would have. All hail Captain Dunsel!

    • @Bruces-Eclectic-World
      @Bruces-Eclectic-World Рік тому

      " All hail Captain Dunsel!"....
      I wounder how many question marks went off over the heads of those that did not get that? 🤣
      Better yet. " In regards to Captain Dunsel"...
      LLAP 🖖

  • @jameswalshjr
    @jameswalshjr Рік тому +1

    Interesting... As a code assistant, possibly. As a coding replacement. Doubtful. Engaging use of the technology. I can see this making boilerplate code writing go away. Probably not a bad thing. Keep up the good work

  • @bones1225
    @bones1225 Рік тому

    Luv your vids. Like to post regularly across the board. “Welcome to the Thunderdome 😂”. We are the cavemen, who are about to see somebody making 😮fire for the first time.

  • @MrDoneboy
    @MrDoneboy Рік тому

    Awesome vid, Paul. I can't wait to try this out!

  • @Dancer148
    @Dancer148 Рік тому

    I just got access to chatGPT and asked it exact your same question also other code making stuff but all I get is over and over again the same answer:
    "As an AI language model, I cannot write codes or perform physical tasks. However, I can provide you with the algorithmic steps and the basic structure of the Duino sketch..."
    And then some instruction without code!?
    I guess it got tired in writing code and now has a living attitude ;-)

    • @learnelectronics
      @learnelectronics  Рік тому

      That's interesting. I had no trouble with it writing the code. Perhaps they don't want that kind of information to get on anymore. I don't know.

  • @deankq4adj125
    @deankq4adj125 Рік тому

    That is unbelievable, VR is becoming a reality.

  • @markmdn6307
    @markmdn6307 Рік тому +1

    Cool idea to demonstrate !

  • @snowdiddley7390
    @snowdiddley7390 Рік тому

    Oh Paul we could get in so much trouble with this. 😮

  • @jflutube
    @jflutube Рік тому

    You said Holy Crap. My sentiments exactly. Great idea for a video!

  • @Keeping_IT_Simple
    @Keeping_IT_Simple Рік тому +1

    ChatGPT is a very useful tool , like any tool it can be used for positive benefit ( as here in this video ) or it can be used for negative ( cheating on exams / homework )
    Thanks for this great introduction to ChatGPT, atr you thinking of exploring it further ?
    Saw your worrying post earlier - please do talk to us about things if it makes it easier !

    • @tigrafrog
      @tigrafrog Рік тому

      @Bence Bujdosó you mean made from a brittle iron, right? keeping this analogy, "steel" is far away, as in another galaxy now. those things flawed by design. Real AI, not this glorified search engine can titled as " steel for a bronze age fellow".

    • @KOAlleyCat
      @KOAlleyCat Рік тому

      @@tigrafrog This is the second comment from you so far that I've seen on here making a negative remark about the possibility of AI and its potential usefulness as a virtual assistant to human programmers. What are you so mad for...? Trying to gatekeep computer science because you don't want dumb normies stepping on your toes? Mad about tools that make learning more accessible? I'm having a hard time understanding why you care so much, unless you're just worried about your own coding skills being surpassed by a bored teen on a Friday night.

  • @rw-xf4cb
    @rw-xf4cb Рік тому +2

    its just absorbed it from Stack Overflow....Give it something you would like to do but have no idea like develop a game of hangman on a lcd screen with the Cyrillic language using a dictionary from Tolstoy? even that's probably doable as one could probably google that in parts.

  • @surfaceten510n
    @surfaceten510n Рік тому

    That was awesome .

  • @jimedgar6789
    @jimedgar6789 Рік тому

    I can see how this could be really cool for us lazy Makers. If kids in CS class start using it to do their homework assignment and don't actually learn anything. That is sorta scary.

  • @satchell78
    @satchell78 Рік тому

    Chat GPT is pretty amazing, however, one thing I found is it struggles with calculating inductors. I asked it to create a python calculator that gives voltage and current when a series or parallel circuit with resistance, capacitance, inductance and frequency are provided. It would always stall at the inductor. If I remember correctly it was able to solve for 1/2pi*f*L but didn't understand how to use reactance...

  • @andrewwilson6240
    @andrewwilson6240 Рік тому

    I would be interested to Google the code it produced to see if it scraped some existing code. Even if it did, the natural language understanding is impressive/scary!

  • @PF-gi9vv
    @PF-gi9vv Рік тому

    ChatGPT doesn't understand power distributed in a series circuit. Ask it which bulb shines brightest when two different wattage and same voltage bulbs are wired in series.

  • @HappyHermitt
    @HappyHermitt 3 місяці тому

    Descriptive details should help

  • @tenlittleindians
    @tenlittleindians Рік тому

    I must have worded my request wrong because all I got was a Far Side comic strip drawing of The Cat in the Hat playing some weird musical instrument called an Arduino that blew bubbles through the bottom of a goldfish bowl and caused the Goldfish to dance.

  • @markclark787
    @markclark787 Рік тому

    I am considering getting this kit from Ali, NEWEST RFID Starter Kit for Arduino UNO R3 Upgraded version Learning Suite With Retail Box $24

  • @sivoltage
    @sivoltage Рік тому

    Its gonna save us all a lot of time, if it can get it right.
    But if it cant then its gonna waste us a whole lotta time. :)

  • @hdguppies
    @hdguppies Рік тому

    He says "Please" to the bot. lol.
    😝

  • @a2zme
    @a2zme Рік тому +2

    Scary is the only word that came to mind thinking about ALL the possible ways this can be used for dark stuff :(

    • @addhoardingprocrastinator
      @addhoardingprocrastinator Рік тому

      the creators of chatgpt have put in a lot of checks so it claims it cannot create things that will harm others. I have tested this a bit and so far so good. It refused to give me answers. Now it also refused to give me answers on even trying to answer my questions about a better s#x life and just gave me a blanket disclaimer about not doing that at all. I have heard some rumors that it is broken in other ways and supposedly the SJW people have managed to control it's answers. Just keep in mind what we learned from HAL in the movie 2010, the sequel to 2001. It doesn't really learn on it's own like it claims. Just like anything else in the computer world you put garbage in you will get garbage out. Even if it makes it look like something useful, which is the scary part.

  • @maxmuster7003
    @maxmuster7003 Рік тому

    Can chatgbt make an executable for MS DOS or DosBox (not the Windows command prompt)?

  • @ivegotpetercriss
    @ivegotpetercriss Рік тому +1

    We are watching the singularity

  • @aeroplane62
    @aeroplane62 Рік тому

    crazy!

  • @daveharwood2843
    @daveharwood2843 Рік тому +1

    Wow indeed! Our parents saw the birth of electronics, our kids will say that they saw the birth of AI.

  • @magnusterminus4728
    @magnusterminus4728 Рік тому

    amazing!

  • @warrenking1815
    @warrenking1815 Рік тому

    Wow, this is scary to me!

  • @tigrafrog
    @tigrafrog Рік тому

    so soon we will have much more "iot" devices with even more security . "machine learning" abominations good as data that dumped in.

  • @johnfitzgerald4628
    @johnfitzgerald4628 Рік тому

    Skynet just went active....

  • @barryolson8428
    @barryolson8428 Рік тому

    Great video. how did u get from ChatGPT to IDE on Arduino?

    • @davesworkplace1616
      @davesworkplace1616 Рік тому

      ChatGPT has a button to "copy code" and then you just paste it into the Arduino IDE as a sketch.

  • @frankowalker4662
    @frankowalker4662 Рік тому

    He's called Glen A Larson. (Sorry LOL.)
    You won't catch me using ChatGPT, when you sign in it wants your Email address and your phone number. I'm not giving a powerful AI system those details. :)

  • @deankq4adj125
    @deankq4adj125 Рік тому

    And AI!

  • @bblod4896
    @bblod4896 Рік тому

    I am frightened for my children and grandchildren.
    I hope the "Three Laws" apply to AI, else we are all doomed.
    Do I hear music from the Terminator or Matrix movies? How about AI Artificial Intelligence, Bicentennial Man, Blade Runner, Ex Machina, 2001 (HAL), Minority Report, Her, I Robot.

    • @Jimwill01
      @Jimwill01 Рік тому +1

      The "Three Laws of Robotics" will never be applied. And, even if it were made illegal to omit them, some fool would discard them in his/her computer.

    • @bblod4896
      @bblod4896 Рік тому

      @@Jimwill01
      😢

  • @TheTubejunky
    @TheTubejunky Рік тому

    some human: "OH NO ROBOTS ARE MAKING ROBOTS AND TEACHING THEM"
    OLD HUMAN: "Sir that is just data transfer. We do that every time we receive an email"
    ROBOT: "MUAHAHAAAA ARDUINO GO PFFFT"
    Humans: "Well then.. We're going to need another TIMMY"!
    (old folks will get this.. source:ua-cam.com/video/nNxsclnYN4A/v-deo.html)

  • @bwselectronic
    @bwselectronic Рік тому

    As usual, science fiction is becoming science fact. Hopefully people will be smart enough to NOT totally depend on AI. Because that could end up with the bad events of science fiction to become real.
    I love automation, but I wouldn't want it to totally run our world.

  • @razpootis5802
    @razpootis5802 Рік тому

    Are ya good, mate? 😐

  • @aidenkaiser9341
    @aidenkaiser9341 Рік тому

    Sorry but I don't think that's that impressive. ChatGPT is a language model constructed from a nearly 45 TB dataset. It uses data scraped from nearly every available site on the Internet which probably includes thousands of "blink an LED" Arduino sketches and files that are publically available. For low level, simple tasks like this it performs exceedingly well but I don't see the real advantage of doing this. Ask it for a more complex task that involves several moving parts like interfacing with an OLED display using the I2C pins and it fails 9/10 times.

  • @tuloko16
    @tuloko16 Рік тому +2

    It feels like the first time looking at a “Dirty Magazine”. That’s the best i can describe it. We know its wrong and can have dire consequences, but do it anyways.
    Its cool and all. It’s amazing how far technology has come thus far. But imagine how dumb out future generations are going to be using this thing. I hear this thing can write college papers and all.
    I still hav’nt dared to mess with it, but its just a matter of time.
    What conserns me it When the tech companies have this thing write a new code language that only “it” can understand.

  • @Bruces-Eclectic-World
    @Bruces-Eclectic-World Рік тому

    It has been brought up the question of how many Ula's, license, GNU/GPL's and so on that ChatGPT has violated to get the answers. It has been suggested that it snags it's code from all the Git's and code that has ever been published Free or Not to use programs! Makes one wounder... I agree it is amazing to see that in real time and it know what you wanted without any questions.
    So there getting us hooked and ready for the terminators and all the other AI's that are going to use us as batteries and take over the world... Lol AWESOME!
    Thanks for this interesting and scary look at what is here now...
    LLAP 🖖
    "Computers make excellent and efficient servants, I have no wish to server under them!" --Spock (The ultimate Computer)

  • @orcasea59
    @orcasea59 Рік тому

    We have no idea how complex ICs work, but willingly plug them in and use them. We can't forge and machine a rebuilt carburetor but we'll mount them in a car.
    Not all of us have the time or skills to write anything but a relatively simple code, but why let that stop us? I have bad wrists and shoulders and can't rip saw a long, perfectly straight board, but I can with my table saw and that allows me to do what I could not otherwise enjoy.
    Making tools is what humans do.

  • @davidward9935
    @davidward9935 Рік тому

    Don't give it access to Elon's Sky network!

  • @markclark787
    @markclark787 Рік тому

    Nice

  • @DeeP_BosE
    @DeeP_BosE Рік тому

    chatgpt does make errors in code, but its random and rare .