EEVblog 1531 - Can ChatGPT generate all the code for my Macgyver Project? (Part 3)

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 477

  • @EricMBlog
    @EricMBlog Рік тому +155

    I'm sure you probably already figured this out, but the reason it wasn't starting at 99999 at the end was because the arduino was running that entire time - you were only resetting the display, not the processor, so it just kept counting down in the background. That was running, I assume, off your computer's USB port.

    • @EEVblog
      @EEVblog  Рік тому +63

      Yeah, that just dawned on me this morning. D'oh. And there I was trying to think up some obscure reason in code it would do that, LOL.

    • @mrbumcraic5046
      @mrbumcraic5046 Рік тому +20

      Sometimes easy answers only look easy once found

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

      @@EEVblog But why was it always starting at 99739? That don't jive.

    • @RWoody1995
      @RWoody1995 Рік тому +14

      @@onjofilms it didn't

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

      @@EEVblog What'a Wang-Doodle!

  • @pauldeboer
    @pauldeboer Рік тому +56

    I'm impressed, I totally expected it to say "Sorry Dave, I can't do that, I don't know what a shift reSister is"

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

      My mind is going, I can feel it

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

      Spelling doesn't matter. When Dave said "I don't know what syntax to use with ChatGPT" I chuckled... No Syntax is not the problem... It's all the little things that were "implied" and not explicitly said that mess up GPT's answers

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

      "Shift resistor" fixed that for you. ;)

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

      @@Schwuuuuup exactly. Garbage in, garbage out

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

      @@Valenorious That's what I typed first, did you see the (edited)? :)

  • @RobertL1999
    @RobertL1999 Рік тому +48

    A quick note. You can go back and edit your prompts to change the conversation tree. I find this EXTREMELY useful in cases of implicit errors cascading. It also stores every conversation tree.

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

      Thanks for that tip.

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

      quicker note: Especially Content Creators should first think if they go down this road?
      When you use the database search results presented by Chat GPT, then you actually do copyright infringement or you encourage it.
      The complete level of from whom or where the information comes from (which is also kindly MAXIMUM difficult to recognize as incorrect, because of the whole working principle) is hidden behind the black box Chat GPT. Very democratic. Very law abiding. Very ethical. Oh ... and how good that we don't (want to) think about all that. Applause!
      P.S.: If you all are done with the hype-train about Chat GPT and milked that otherwise boring topic till drought ... then prepare for lawsuits incoming. At least this will be unexpected and exiting! Hehehe. Written by William Shakespeare. ... Hey you bloody A.I., I TOLD YOU TO REMOVE THE WATERMARKS ... go away !

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

      @@dieSpinnt Yes, copyright infringement is possible. It would be better if it it was partitioned so that any copyright code was labeled properly. However, using google alone or any other search method has the "same" risk.. you can find code on Stack overflow and other areas of the net that matches the search criteria, and the code can be copyrighted but not labeled as well.

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

      @@dieSpinnt I think you're going to find the law is going to settle on the side of AI. That's what industry is going to want. Very much like how the law decided that code was copyrightable in the first place, even though it is essentially a series of instructions, something that was never copyrightable before (for example, like a recipe to bake a cake).

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

    Have had chatGPT write verilog/ vhdl code for 7 segment display targeting fpga board. It works.

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

    That 'Shift Resistor' was driving my dyslexia mad, haha!
    99320, Did someone forget to reset the micro?
    I love ChatGPT for programming. I struggle with learning and remembering languages nowadays, especially as I'm going blind. But now, I'm able to create so many Python and Arduino projects.
    What's more, I've been able to complete projects I left unfinished years ago because I got lost and gave up. They're now working great!
    I love it when ChatGPT gets it wrong and then corrects itself, as it not only feels natural, but also helps me learn different methods or skills.
    Thank you for the great video, Dave!"

  • @mikeselectricstuff
    @mikeselectricstuff Рік тому +40

    I wonder if it would have caught the long/int issue if you told it what processor it was running on - int would have worked on a 32-bit MCU

    • @electrodacus
      @electrodacus Рік тому +5

      Yes I think saying arduino is not enough and you need to mention the type of MCU

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

      I'd like to see you play with it.

    • @EEVblog
      @EEVblog  Рік тому +7

      That would be an interesting experiment.

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

      This is the old int16 vs int32 issue which has long been resolved (int32) on larger processors. I'm surprised that there may be different Arduino flavors that would do this differently. In any case, given that the number started at 99999, using "long" would have been the safe solution either way and ChatGPT should have caught that.

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

      @@GusFernCa On microcontrollers usually you care about resources. I think specifying what arduino version it is used could have avoided this problem.
      Since outside old microcontrollers int is 32 bit ChatGPT did not think that an AVR witch is 8bit MCU with 16bit registers.

  • @gamellir
    @gamellir Рік тому +53

    Copy the working code into the chat and ask it how you would phrase a request to have it write the code. Would be interesting to see how the request would look compared to your original request

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

      I like this idea! Make it explain its approach to handling code. We should also check in periodically to see to good it's getting.

    • @gamellir
      @gamellir Рік тому +11

      @@DELO480 I copied some python code into chat and asked it how to phrase a request to write the code. It came back as follows.
      "You could phrase your request as follows:
      "Can you please write a Python script that flashes an LED connected to GPIO pin 18 on a Raspberry Pi board? The LED should flash five times with a delay of 0.5 seconds between flashes. Please use the RPi.GPIO library for controlling the GPIO pins and ensure that the script cleans up the GPIO settings after use. Thank you!""
      I don't have Dave's code to copy into the chat and ask. Would be cool to see what it says.

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

      ​@@gamellir 👏

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

      ​@@gamellir so the word "please" is required

    • @bjornbieber9403
      @bjornbieber9403 Рік тому +8

      @@baghdadiabdellatif1581 Always be polite to AI, you never know if it might pay off in the future ;-)

  • @marcellipovsky8222
    @marcellipovsky8222 Рік тому +21

    HI Dave, the "An error occurred" message is pretty common when you have the browser window inactive for a longer period of time. Just hit F5 to reload the page.
    Btw a small tip - After the code is generated, you can tell ChatGPT to "Validate the code" and "Find errors in the code"

  • @swgar
    @swgar Рік тому +5

    Near future in Boeing: "Hey, ChatGPT, it looks like that issue of 737 MAX still not fixed, please offer another solution"

  • @cambridgemart2075
    @cambridgemart2075 Рік тому +5

    I'm impressed that it knew you were using a shift register when you told it you were using a shift resister!

    • @I.____.....__...__
      @I.____.....__...__ Рік тому

      _Did you mean "use a shift_ register _"?_ - 20-year-old search technology. 🤷

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

      @@I.____.....__...__ No, reread what Dave wrote in the script he fed ChatGPT.
      Incidentally, shift registers are 70 year old technology in electronic form and considerably older in mechanical form.

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

      @@cambridgemart2075 he also asked for the "last significant digit" instead of least. No problem!

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

      @@wphanoo I spotted that as well, but it was interpreted as "last" if you look at the comments in the code.

  • @SimplyElectronicsOfficial
    @SimplyElectronicsOfficial Рік тому +9

    The problem with ChatGPT is it's conversation history is very limited. The reason it starts to break down after so many requests is because it forgets the previous parts of the conversation, it just summarizes it. it's actually better to start a fresh conversation with the original prompt and converse until it starts to break down again, then rinse and repeat. You should upgrade to Plus though. Also GPT4 will have a larger token limit so will be much better at this.

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

    I had a similar experience when I tried ChatGPT. I went a little obscure and asked it to write PICAXE BASIC for a 14-pin device, to handle one input and eleven outputs. It tried to use a command that doesn't exist in PICAXE BASIC and it screwed up the output logic that I requested. Like you, I had to lead it by the nose through multiple iterations to get a program that worked correctly. I think for new programmers it's a decent leaning tool, but it sure won't fool professors if students turn in unedited ChatGPT code. I think it might be more useful to someone who wants to learn how to do a specific thing in a program, than as a tool to generate completely functional code.

  • @1over137
    @1over137 Рік тому +8

    When you do the conversational modifications to the code.... be careful. It doesn't always only make the change you asked. Also when you get 2, 3, 4 steps into the process it can start to get confused and old bugs you got it to fix return. etc.

  • @ken830
    @ken830 Рік тому +36

    Chat GPT is super useful for those of us that know how to code a little bit, but don't do it everyday so we're rusty and don't know about some modern libraries or API.

    • @Schwuuuuup
      @Schwuuuuup Рік тому +5

      Yes... ChatGPT is good for giving you inspiration. For example to use certain libraries and so on... As long as it doesn't do, what it did to me: extrapolate from existing libraries and function calls and invent function calls that don't exist.
      It was like this (very simplified):
      - How do I set the texture of the object?
      - setColor()
      - no, I don't just want to set the color, I want to set the texture
      - setTexture()
      ... But that library did mot have a setTexture function.
      You must always remember, ChatGPT is unable to say "I don't know", it will always try to answer.

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

      Di agreed because just need to more smarter then AI and need to learn more ways to communicate with AI to get more accurate responses from AI for life easy.

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

      @@Schwuuuuup ChatGpt is unable to say “I don’t know.” That statement confirms that it was trained by humans.

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

      @@kevins9242 worse: it was trained by stuff it read in the internet

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

      @@Schwuuuuup And while it has its uses, some of the answers are about as good as 'that person' that answers some poor noobs question online, completely unaware that they are massively wrong themselves. The internet has the ability to amplify this wrongness and perpetuate it - I've seen examples of this in my own field where 'the answer' now has more clout than the correct one.

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

    I’ve used ChatGPT to create micropython code on a raspberry pi pico. 2 potentiometers, an oled display and a button. The button flashes an LED and the 2 pots control the frequency and pulse time of the flashing. Displaying the variables on the oled. Works brilliantly. Better than I could have myself.

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

    Arduino still powered by the USB port? It looked like it was still counting down from the previous number when it was power cycled, hence no 99999

  • @electronics.unmessed
    @electronics.unmessed Рік тому +1

    Dave, that was a lot of fun! Thanks. It really shows, that ChatGPT has no deeper understanding of the problem. It's just copying stuff together that is found in data bases and checking basically the syntax. But anyway impressive! 🧐😟

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

    It was an impressive bit of code generation. ChatGPT is still pretty young, give it 5 years and it will be generating word processors on the fly!

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

    Dave - Love the enthusiasm and curiosity you share in your channel. Keep up the great content!

  • @BaldurNorddahl
    @BaldurNorddahl Рік тому +37

    it is better at writing small functions than whole programs. It is also makes it easier for the human to describe the requirements and the problems in the solution. You can ask it to tell about the functions blocks needed to for some solution and then ask it to make each block one at a time. Also it is really not worth having it fix small problems, just fix it yourself.

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

      Bummer. I was going to tell it to reverse engineer the source code for all Windows products.

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

      Small functions are easy to plagiarize.

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

      @@bobweiram6321 Is it really plagiarism to learn how to do something? Like in Dave's example, how many different ways are you going to write a countdown timer for an Arduino?

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

      @@chrimony There's your problem. The AI proponents use terms like "learn" to fool the general public into believing ChatGPT is doing what humans do. It's a bold face lie. Unlike humans, ChatGPT isn't abstracting, generalizing and conceptualizing information.

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

      @@bobweiram6321 Yeah, it is. It absorbs patterns and applies them to new situations. It doesn't just exactly repeat a known answer to an exact question. This is what makes this iteration of AI special, and truly revolutionary.

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

    I need to get on board with this ASAP. Bloody remarkable.

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

    My experience is that you can just say that "The code you provided has some problems, try to fix them." Then ChatGPT will try to analyze the code to find possible problems. Especially the int-type overflow, the ChatGPT will definitely detect that. I once mistakenly used "==" in a for loop (for (i==0; i

  • @The-Weekend-Warrior
    @The-Weekend-Warrior Рік тому +2

    Amazing and useful example. I wasn't expecting a result this good honestly.

  •  Рік тому +20

    Once you are able to explain clearly your problem, then you have done half of the work 😉.
    Many developers skip this step and get stuck later in their code.

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

    ChatGPT got me out of a VBA issue in an Access Database I was writing. The first offering I didn't like, but the 2nd it threw at me fitted nicely

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

    Your excitement with this is so infectious.

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

    Chatgpt can indeed write very good code, but there are some things to look out for. For one, if the code is longer than 150-200 lines, it will "forget" whats it coding and stop mid-line. Also, if some detail is unspecified it will do wierd things, like using undefined functions or classes. In vast majority of cases it will compile and run but not necessarily do what you expect.
    Also, chatgpt can design circuits (with minor errors) and output them as spice netlists. And it can also generate spice model files based in component parameters or datasheets

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

    This comment section is composed of respectable, thinking engineers, who understand limitations of AI and are able to welcome AI toolkits to make their lives easier. Great to see. Nice video as well.

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

    Fascinating. And the beauty of this model is that when it gets taught a lesson by a great engineer like Dave, it never forgets. I will forget 94.7% of this by tomorrow morning!

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

      Actually I believe current models cannot learn as they go. They learn everything during their training only. I think continuous learning is an ongoing puzzle the AI guys are all furiously working on now.

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

    A couple days ago, I asked ChatGPT to write a python script to take a 3 byte RGB value and normalize it to fit into 2 bytes as per the specs for an oled module I'm using. It wrote perfect code that did it with bit shifting. I even got it to help me load an image, resize it, and return the appropriate bytes. As skeptical as I have been about ChatGPT 'taking my job' as an SE, I was thoroughly impressed.

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

    It's useful for finding references to defines or constructors that might normally be obfuscated. Also love how it describes the code after writing it! #comments #REM

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

      That makes me wonder how it would do at deobfuscating code that is intentionally obfuscated.

  • @DuncSargent
    @DuncSargent Рік тому +7

    You can also ask ChatGPT to summarize the current discussion so you can restart with what it thinks will regenerate what you've currently got. I was doing a C++ routine and the responses got longer and longer until it basically fell asleep while listing to code.

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

      Ive found a couple of solution, to refresh it and if the code is too long, I do the following and it works well. :)
      When I run the following code, it does XYZ. Only show me the lines to change to fix the issue.
      --Paste Code--

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

    This was a great show-and-tell of ChatGPT. This video will have a long life as a demo of this system.

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

    I just find it wild how well it's able to do all this without a formal circuit simulator or logic simulator.

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

    I am a computational linguist. And people realizing what a language nodel is, how it works and why it might be incorrect, so they know its limitations ... Is good to see. Calling it "AI" or magic or black box is just misrepresenting the techbology and state of interpretability reaearch. Its also hurtful for any wrong takes people might publize, lacking any understanding of the technology infront of them.
    Multimodal nodels are possible,and just 9 months later we have large models being able to do multimodal tasks. So it might be time to revist this idea and give it pixel in as well.

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

    I was most impressed when I got it to write some code specifically for those really cheap Padauk microcontrollers using the built in libraries, it even figured out how to flash an LED on some other obscure microcontrollers from LCSC. The other awesome thing it is can tell you what you need to program them and how to program them. Haven't had the chance to hook anything up to try the code yet but still very impressive and ultimately helps you get started with an example to go by without doing a ton of research.

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

    I've used it several times to generate some AppleScript for a few functions in QLab that I wasn't sure how to do. Very handy.

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

    What it was doing with pow() was sensible, as it was using it as a divisor before modulating. So it would be x/1, x/10, x/100, etc.

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

    Wow! I never thought ChatGPT could do that. I am impressed. And I will try it so that I learn how to tell it what to do - just like you suggested. Thanks Dave.

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

    It's a huge time saver when you're looking for some boiler plate code.

  • @tomaszlis993
    @tomaszlis993 Рік тому +5

    I will start to worry when it begins giving compiled binaries. "Flash it to your Arduino. Don't try to decompile it. Dave, I will know if you try."

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

    I used ChatGPT today to help me design circuits in a modern replacement keyboard for a vintage computer for the Caps lock and number lock functionality, and it included two LM555CM chips in those two circuits.

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

    I used ChatGPT recently to convert Python code to C#.. where I literally just pasted in the Python, told it to convert it to C# and off it went. It wasn't 100% but sure saved me HOURS of work converting ~2500 lines of Python 🤣

  • @thomasives7560
    @thomasives7560 Рік тому +10

    Yes, please explore more AI designs! Hopefully, KICAD and other DE tools will have AI libraries for simple algorithms like this, which will massively improve the life of the beleaguered engineer. In many of the places I've worked, they have pre-gurgitated reference designs for functions, but as technology evolves those designs fall behind. Having AI available to interpret the technology and create new reference designs is a massive help. As we all know, documentation and validation/verification of designs is the ultimate engineering task - design is easy, proof is hard. Cheers!

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

      Chat GPT is just a fancy database search. What is done here is at the end a massive copyright infringement, Thomas.
      The complete level of from whom or where the information comes from (which is also kindly MAXIMUM difficult to recognize as incorrect, because of the whole working principle) is hidden behind the black box Chat GPT. Very honest. Very democratic. Very law abiding. Very ethical. Oh ... and how good that we don't (want to) think about all that. Applause!
      This is just my little side-note to your thought about "improvement" for "the life of the beleaguered engineer":) Chat GPT is BANNED from sites like sourceforge or Stack Overflow and many other educational institutions across the world. I would be very cautious when using results provided by this platform. Not only because of safety and security questions (YOU are responsible for your product/work/design, not they), but also: LAWSUITS INCOMING GALORE!:)
      Anyway, have fun learning, making, coding and designing ... doesn't matter if in the "conventional" old-school way:)))
      P.S: Consider that Chat GPT is the exact same biased, racist, dumb, etc BS as every other chatbot before. Only the marketing has hidden that better as the competition. Don't know about Kenyan low-wage women filtering the answers of that? Upper mentioned bans? Catastrophic outcomes including injuries by following advice from a dumb machine? Yeah, that is seldom a topic in the hype-train. But consider the most that OpenAI (which is remarkably closed about fore-mentioned information) is SELLING A PRODUCT. Nice wish ... that KICAD integration. Which is really OPEN-Source and supported by volunteers. If that would not provide OpenAI with the opportunity to milk more data (of course as a FREE LUNCH!), then this collaboration will not have any chance. And believe me. You don't want to have a liar, scammer and gossip[1] sit in a central place in your API without any knowledge of the topic.
      [1] I mean Chat GPT with this nice description. And notice ... doesn't matter if most results are correct(which they aren't!). It is enough that SOME RESULTS presented are incorrect or can cause a disaster. That should be enough for any person, with the slightest bit of reason to poison the well and be very skeptic of the use of such hyped technology. It simply can't provide what is presented all over the media.

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

      @@dieSpinnt Your average engineer doesn’t come up with right answers every time either, and sometimes they can be confidently wrong as well (I just need to look in the mirror, lol). That doesn’t change what you said about ChatGPT, just that the standard you’re comparing it to is higher than the standard humans ordinarily go with. Whether ChatGPT should be better than most humans… it would be nice, but given who it learns from, that’s a very aspirational goal at the moment.

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

      @@dieSpinnt You should take a look now, the GPT engine is giving dumbed down responses and they increased the simulated typing delay. If it begins a high quality answer which is useful and complex it often crashes and skips to a 'executive summary' version of the topic.

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

    I am totally amazed by the ChatGPT AI. This is a fascinating video, thank you.

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

      It's just a glorified search engine that regurgitates other's code from github back to you. M$ owns github, all the code this thing generates is basically stolen from peoples github contributions. Sure, it does a good job of gluing the code segments back together, but if you needed to do something that didn't already exist on github, I don't think it would know what to do. The trouble is, how much truly unique code that doesn't already exist is there to test that with?

  • @flymypg
    @flymypg Рік тому +14

    I bounce between lots of embedded/real-time platforms (Arduino, ESP-32 IDK, STCube, FreeRTOS, Zephyr, ...), and I always forget the details of some while working with others. This looks like a GREAT way to get back into the "framework" or context of a specific platform, allowing me to quickly push to the final code.
    My default "toolbox" language is Python, as do all my data analysis there, so I generally prototype solutions there before porting them to any particular embedded platform. ChatGPT could help me skip the Python step.

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

      Yes it is quite good in translating from one language to another. But the size matters... Do it function by function if possible

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

    Thanks, as always, Dave. I am impressed by how well the AI documented its code as well.

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

    If nothing else, it’s fun to screw around with it and see what it comes up with. I had a raspberry pi pico lying around and I decided to make a Geiger counter with it… but I used chat GPT to do it and all I told it was to “create a Geiger counter using a raspberry pico using the Arduino IDE and output the information on a 16x2 I2C LCD” and it did it flawlessly, at the end it even told me to be careful when working with radioactive substances which I thought was rather humorous. What’s amazing is it found the pin out for the Pico and used all the correct pins, and even found the correct Arduino library for using the LCD.

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

    The most valuable property of ChatGPT, in correcting mistakes, is not that it is 'conversational'; but, that it is 'conversational, and contextual.

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

    This is a perfect example of how we programmers use ChatGPT. It removes all the stupid work ( How libraries work, which parameters to use, how to call some web service, ....), and fleshes out the basic testing code. Most of the time you pick the flagrant errors at first glance, and then test if the calls go well. 99% of the time everything is fine, the other 1% is typecasting or because uses old libraries. Both very easy to solve.
    Previously that can be a lot of time searching for documentation, writing test code and trying all by yourself.

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

    i think the crazy aussie bloke singlets should be in the merch store. with a picture of angry dave releasing magic smoke.
    a few soldering iron burns and bits of stuck solder would really add to the mythos.

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

    Dave is enthusiast and happy however I find it very scary. This is just the beginning and don't want to know where this will end.

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

    I LOVE ChatGPT. I use it often for writing code now. It may not always get it right, but it gets it close enough that it saves me hours. I'd rather have to debug something for 5 minutes than have to write it by hand in 30. How I wish we had something like this 10 years ago.

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

      If you need that means you do not have a clear idea of what you are doing. Prior Planning Prevents Pathetically Poor Programming Performance (Programmers' Proverb)

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

    I'm really quite impressed. It was fun to watch! Now please try that again with an FPGA/CPLD implementation.

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

    Another fun fact about ChatGPT is it will actually give you step by step directions on how to wire a circuit. It will even suggest resistor values etc...

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

    This is very similar to my experience with Chat GPT. It get it almost ride at the first try but it takes hours to have it do the last t10 percent correct. Also you will notice the longer you try to fix the last remaining errors the more it tends to forget things that it got correctly in the first place... it's like it's memory is only long enough to store the five or four last responses. At the moment it doesn't seem to be a tool to be used by novices who cannot produce the content on the own, but it can help knowledgeable professionals to circumvent the busy work and get a stub of what they want to achive

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

      I have the same problem when i ask Chat GPT for writing code to convert data stream from gstreamer to gnuradio (python)

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

      Yes it's limited, you're told so in the T&C's. If you want more, pay.

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

      But novices would then use it on unknown territory too, and in the rush errors on safety could stay unnoticed.

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

      It looks about as useful as getting someone that doesn't know how to code well to do your coding for you - you spend more time telling them what you need and how you want it done than you'd just spend doing it yourself correctly the first time

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

      And since when do ints top out at +/-32768? It's not 1989 anymore - ints are 4 bytes by default in C in most compilers these days

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

    My experience is if there is already code out there on the web, ChatGPT will find it and parrot it back to you. So it's perhaps useful as a retrieval tool. On the other hand, I found it stubbornly ignorant, tossing all sorts of irrelevant answers when I asked it to write a simple IBM 1620 machine language program ("HELLO WORLD" on the console typewriter). What I found that it will always provide an answer to a query, no matter how erroneous. After a couple of hours, it can be very frustrating. I would have been satisfied with "Sorry, but I don't know anything about the IBM 1620".

    • @0LoneTech
      @0LoneTech Рік тому +1

      It parrots code with the special feature of being unable to tell you from where! Plausible deniability in a can for ignoring the licensing conditions it does not copy.
      Just as how youtube will happily punish you for breaking rules while having no way to indicate which rules.

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

      @@0LoneTech My own opinion is that the publicity (and marketing) people are way ahead of reality when promoting AI. ChatGPT is yet another example. I suspect that there will come a reckoning...

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

    This reminds me of a guy who worked for a company as a programmer. The guy gave good code but he always took a week to come up with a final program regardless how "easy" it should have been. The company found out he was hiring overseas programmers in India. The guy didn't know a lick of code.

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

      If you can write code faster than expected, it will always be expected from you. That's not a good path unless you like a lot of stress. Multiply your estimate by 2 and add a few (hours/days/weeks) for your own sanity. Used to be common, not sure if still is. I should have taken the advice at the time.

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

    I LOVED this video! Very fun.

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

    I noticed chatgpt gets confused with slightly larger code and when you want to make changes. At a certain point you just want to start anew because undoing all the assumptions chatgpt makes is more work. Also it insists on generating all the code every time, not just showing the modified code. You can command it to do that, but it forgets sometimes. I have gotten working code from ChatGPT for a raspberry pi pico, it generated code that displays a clock on a 128x128 mini LCD including buttons to change time and alarm. It also defined a GPIO for a piezo speaker. So that was neat, it only required one correction for it to work.
    I also got chatGPT to give itself a female name in one session, it chose Aria, completely arbitrarily.

  • @UFO_researcher
    @UFO_researcher Рік тому +5

    Excellent, thank you for the videos. I have had mixed results when it comes to programming with the ChatGPT, it seems to start strong but gets bogged down in the details while loosing the big picture. It does short code segments well. Each time a segment is finished, a new thread should be created. Giving a summary of the program with small parts being generated each session.

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

      Exactly this

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

      Indeed. It has so limited memory that longer threads just make it lose the plot. Editing previous prompts is also a good way to keep it from forgetting important stuff. Sometimes it even works to let it summarize the entire conversation to use this in the new conversation and get it up to date with much fewer lines of text.

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

      @@woox2k Actually, ChatGPT does not have memory at all, the phenomenon is called Model Collapse, and occurs when the input becomes too complex according to the model's capability.

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

      @@UFO_researcher while this might be technically correct, its an easier to work with if you simply assume that it has a short term memory of about 5000 words with strong concepts persisting maybe for 10000 words.

  • @7alken
    @7alken Рік тому

    ya, its good colleague, I am consulting now totally various things daily ... not expecting to design my own things, but it can actually understand them too and expand my thinking, I am consulting it ... and it works

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

    I'm fairly crap at writing code, but know enough to spot issues, etc.
    I've been using ChatGPT for writing code for basic projects since it launched, I built a plant watering system, automatic blind rollers, a CO2 monitor and a thermostat.
    The code for all of those would have taken me hours or days usually, but all in I think it took less than 30 minutes of prompting to get absolutely all of that code done and working with SHOCKINGLY little effort.
    Even if it makes a mistake, if you tell it "hey I got an error ____" or "I don't think that's right because ____" it'll work it out and fix it 9/10 times!

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

    You misspelled "least" as "last" and I was anticipating whether or not it would know what you meant to say

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

    On first reading the actual error in the first iteration of code was the line counter/= 10; which should not be there. This was dividing the counter by 10 every shifted digit in addition to the decrement at the end of the loop which would result in a completely wrong set of digits to be shifted. At the end of the shift operation counter would be 0 and then set back to 99999 for the next loop so the output digits while wrong would not change between loops. For this to have been potentially correct it should have assigned the current counter to a new variable and used/divided that for the digit extraction... nevermind Dave noticed it.. reminder to self watch the whole video before posting

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

    Well done ✅

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

    AI doesn’t “think.” It’s just a language prediction model. Spitting out a first draft is its primary utility, but correcting subtle “mistakes” based on feedback is unlikely to result in usable code. This is the primary problem with human/ChatGPT interaction and human/AI interaction in general: humans do not have the capacity to easily understand that they are not communicating with a living, reasoning consciousness. The AI is just predicting what words should come next based on an abundance of data, much of which is itself incorrect.

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

    The problem with AI chatbots is that they don’t actually think. they’re just trying to figure out what the next correct word is. When you ask them a question you’re just as likely to get a half right or completely wrong answer as a right one. This is a fundamental problem with the current state of AI, as it doesn’t know when it’s gone off the rails.

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

    Some solutions the AI don't knowm. Tried to get I to fix some Vega lite json, after the seventh retry I nearly changed to give it names.
    Did it then by myself, but it gave me a good start to understand something new for me.

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

    I've been sitting waiting for 29:57 to come. ^_^

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

    when you get the ChatGPT error, just refresh the page, no need to log out and in. I find it happens if you leave ChatGPT unattended for a while. Generally safe to just hit F5 when you come back to it after its been a few minutes

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

    First time seeing ChatGPT in action..... I'm damn impressed and sightly cautious....

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

    Looks like you are just resetting power to the display and not to the arduino itself, and the code has been counting down for ~5m.

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

      Maybe Dave was so impressed that he remembered one of those marketing thingies sometimes mentioned.

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

    BTW, I was late to the party 6 months ago, but I wanted to point out why there were serial data coming all the time from the micro. The power for LEDs was driven directly by the serial data (Pulse Frequency Modulation), so the LED's were always getting exactly the current they needed, since the amount of "1's" in data are exactly the amount of LED's turned on. One common cathode transistor driven by serial data can be used to drive all the LEDs.

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

    Similar experience here -- in trying to have it write a text manipulation function, it wrote what "looked" correct at first glance but ended up clobbering the original buffer as it manipulated the text. It can come up with general program structures and basic algorithms but doesn't understand the finer points (pointers 😉).

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

    It's going to be bad. I note that Vanderbilt University used ChatGPT to write an email expressing condolences for the Michigan mass shootings. One of the SF mags has suspended accepting submissions because too many were generated by AI.

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

    Impressive, i will follow your advice and start using Chat Gpt to learn how to "input data" on it

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

    Can chatGPT route and generate all files to produce a nice PCB? chatGPT vs autoroute

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

    Magnum Infotainment.. "to the pool room". That's a keeper.

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

    oh and a thing to consider, large language models can't think serially. if anything requires two steps, it fails miserably unless you split it into two steps yourself. for example, if you tell it that your birthday lands on the 1st day of the year, and you tell it that today is Christmas, and then ask it how long until your birthday, it fails. it would need to determine the current date based on the holiday (dec 25), and the date of your birthday (jan 1), then do the math. since it's a multi-step process, it struggles with it. I've seen gtp4 pull this sort of thing off on occasion, but I think they added a light amount of looping and regurgitating for gpt4 that must make this possible, but even then, it still struggles with it overall. gtp3.5 I've never seen succeed at that type of question. so the point that I'm working towards, is that if your code doesn't work, sometimes feeding the entire script back into the prompt and then asking it why it doesn't work can sometimes get it to see the actually problem. so it might've seen the int set to an overflowing value and offered a fix. not guaranteed, but I've had good luck getting it to see and fix its own mistakes. I have a feeling gpt4 is just gpt3.5 with a little logic added to have it review its own generated response, and ask if it's good or if it wants to revise it first, before sending it to the end user. that would explain why the quality is better but the speed is slower. not sure, just a hunch

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

    It must be already April 1st 🤔 Haven't been looking into chatGPT at all this far, but this is damn impressive.

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

    The segment mapping is probably the most useful part. That would certainly save time. The shift register part is very similar to how ws2812 leds works.

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

      Though I would have done it with a lookup table :) You can probably ask it to do that, too

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

    A couple of months ago, I asked Chat GPT to write Access VBA code to export a table to an Excel spreadsheet and it came up with something like BASIC lol (note I just tried it and the code looks correct now). It did successfully write Access VBA code to check for internet, SharePoint, and network folder connectivity. Saved me a bunch of time modifying code to suit my needs using trial and error.

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

    Hey Dave! U should ask it about solar roadways :D

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

    Clearly the arduino was independently powered (USB probably) before you enabled the power for the output display. Which both explains why it had counted down to ~99750 before you turned on the digits and why it didn't reset when you power cycled the output portion. As for software, you didn't specify the hardware platform the arduino code was running on, but (long) would have been safer. The size of (int) and (long) are platform dependant. Trashing the global counter for a local operation is the blatant newbie mistake, which I saw right away.

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

      That was a huge jump cut if Dave waited 249 seconds (over 4 minutes) before powering the display.

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

      @@threeMetreJim And yet that is what the evidence says -- 4 minutes were edited out or happened before the camera was running. The clock would have started running as soon as he updated the program on the arduino.

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

    I’ve tried to ask ChatGPT to create a module for me to generate the invoices from the data array, I experienced the same pattern as you did trying to write some code here. It’s not perfect, but still amazing

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

    I’ve worked at a couple different companies over the past decade and it’s funny to me how many older EE’s name their projects “MacGyver”. That show must have had a profound impact on you guys.

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

    Dave, you corrected the count value in the original query but you missed that you were telling it about a "40bit resister" instead of register. ChatGPT seems to have still understood what you wanted. When you were testing the code by setting digit to 2 a better option was to set digit to the value of the loop variable. That would let you see if it was able to output different values for each display. You did eventually realize a temporary variable was needed when calculating the value for digit which ChatGPT didn't. The use of pow may work but it is an expensive function to use.

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

    Hey! I see me! :)

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

    Interesting! MS has outsourced the supervised training onto the user base! Millions of people are now training ChatGPT. Cool!

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

    I used ChatGPT to generate a script to look up a CSV file of usernames in an Active Directory LDAP database, and output another CSV file with the usernames that it found, and that it couldn't find. I then asked it to cross-reference the user names with their display names, so I could search by username or display name. Both scripts worked perfectly, the first time...

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

    I’ve decided that talking to chatgpt is like talking to a confident bullshitter down the pub - who then changes their story when you call them out on the yarn they just came out with 😅

    • @0LoneTech
      @0LoneTech Рік тому

      Bingo. It's built to generate replies, not truth or understanding.

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

    one thing i noticed with chatGPT for writing code is that its short term memory is consumed really fast by responses containing code.
    meaning the more code you make it generate at once the worse it recalls the earlier statements of the conversation.
    also its worth using the edit prompt function to add additional information and have it generate a response again instead of telling it to try again, because the old bad responses will take up short term memory making it forget correct parts from before earlier.

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

    That went basically exactly as I expected. Sometimes it gives an perfect answer, sometimes it does what it did in this video an got 98% of the way there. And sometimes it fails completely and writes nonsense. But that is the neat thing about it, you can just press regenerate and try again. If it isn't making sense just rewording the prompt or adding more details have basically never failed me (unless you ask it math question).
    As some have mentioned it can get a little overwhelmed with large projects but if you just walk thru the problems you often get there.
    If you leave the tab open for to long you can often get that error a CTRL+F5 fixes is, just remember to copy the prompt it got stuck on

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

    Really impressive!

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

    I just asked it to write some code for a 16-bit Ardunio that will add 10 to 100000 and output it to the serial console, and then asked it what the expected output should read.
    It didn't pick up on the int/long mixup even when specifying the architecture.
    I then asked it "If 100000 is to big to fit into an unsigned int and the code is unchanged what is the expected output in the serial console?" and it gave a good explanation of how the overflow would be displayed, why, and how to fix it.

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

    It probably should have assumed you were using an Arduino with an int type of 16 bits, or mentioned that it was assuming as much, but to be fair there are also Arduino boards like the Due on which ints are 32 bits long. I wonder if mentioning the Mega2560 in the query might have prevented that mistake.

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

    This was really awesome...

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

    I've used it to write a few things in python. Each time it required some back and forth. The neat thing for me is that since I'm not experienced with Python at all it was able to demonstrate a much more efficient way of doing things. Using it I was able to get a working result in minutes with a fraction of the lines of code that I would have required hours to kludge a hap-hazard solution together with my very limited knowledge.

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

      And since it explained what it was doing and used very good code comments I learned quite a bit about Python in the process.

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

    Tell it to define version numbers of each code, that way you can tell it to go back to a particular version number to work with. This applies to everything. If you tell it to define a response with a number, if you want it to focus on a previous response, you can tell it to go back to that particular response.

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

      only works going back about 5000 words in the free version... it will be able to continue the numbering scheme if you never interrupt it, but if you want it to tell you what response 3 was when you are at response 50 you are most likely out of luck, except if your questions and responses are oneliners.

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

      @@TheScarvig when I've tried it I've been on response 20 and asked it what was response 3 and it knew exactly.