it gives you code that it is very confident about, which often doesnt work, and sometimes it just stops in mid response. a useful tool but it has to be watched very closely- like a junior employee who thinks too much of his abilities.
the AI is not confident, I've spent considerable time working with it. It sees many ways to do things, the best thing to do is work on small portions of logic. it is also very good for generating boilerplate, and boilerplate sucks to write
You can instruct the chatbot to start answering at a certain point and get a long answer. Either you give the entire previous answer and say "continue from here" or you give the last few lines.
One key benefit I think your missing off chat gpt is the ability to have it refine things. So when you are missing a library just say something like "it looks like the library for... was not included" and 9 times out of 10 it will either give you the snippet of code or include the library. Involving chat get in the troubleshooting is half the beauty of it. It knows the exact context of your query so it's usually faster and getting you the correct answer then a Google search... unless it a decides to spout a bunch of nonsense. In which case it is usually still faster to guide it to the correct answer out just use the try again button to have it try something slightly different.
@@TheCatherineCC the only downside to the libraries is that it makes it *too* easy and you don't have to struggle to learn the hard way which creates more neural pathways in your brain and basically makes you smarter.
@@drumbum7999 I suspect it's balanced out by the fact that someone new to this all can buy a $3 part off aliexpress that is fairly well documented and get things working in a fairly short amount of time, becoming passionate about coding and hardware. It's not like 30 years ago where you had to spend some seriously frustrating time to get something stupid like a LCD screen working. Not everyone is going to code firmware, but someone with "the bug" is far more likely to. If a million monkeys will eventually write shakespeare, a million people playing with $3 ESP32s will make some cool shit too. But yes, it feels way too easy in some ways. After a long break, I got into writing actual code again playing with these things, and it's sooooo much easier. IDEs don't suck, it seems literally everything is just on github, people are actually documenting their code making it easier for others to understand and build off it. It really feels like a generational leap forward happened and society didn't realize it.
The successive refinement is really something. If you generated Blinky, for instance, you can follow it up with: "Change the LED to pin 0" And it knows the prior conversation and improves on the result.
There is a limit for the length of the response. But you can type continue and it will finish the code. Also when you got the ADC DAC overflow, you could explain your issue and it will correct most likely. You can also paste your code and ask for help. In the video you asked for Arduino code, my guess is it would help if you specify the model.
Great video! As a hobbyist, having an “assistant” to deal with all the minutiae of connecting to a new sensor or display, or to just take the tedium out of making a UI frees up so much of my time and brainpower for actually making cool stuff instead of figuring out how to cajole the system into doing what I want. In that context, I don’t feel “obsoleted”, but rather enabled; it’s just a higher level of programming; the programming language has become conversational, iterative English. This is gonna be *so* great! 👍😃 I bet it would also be very helpful in debugging programs too: Give it the program, explain the problem, and ask it for the solution. That’d be interesting to see a video on as well. (Next step, use the speech-to-text function on your computer to feed it input. I can see a day (very soon) when we can work with it all the way into even hardware debugging, probing a circuit and telling it what we find, so it can suggest the next thing to test in the debug tree :-)
Beware. "Creative" AIs tend to cheat and imagine nonsense when they don't know the answer, and possibly not even notice that they lie (because the output is assembled from guesswork based on correlations of things it read elsewhere). So it is not like asking a teacher, but more like asking a semi-educated imposter.
I was playing with this last night, and even telling GPT to integrate an Arduino with an automotive transmission (!!) it got it largely right! If nothing, it saved me hours of work by giving me a framework to start from, and I can just tweak it instead of starting from scratch. Boy am I glad I'm retiring shortly and don't have to worry so much about being put out of work by this.
I mean, for those who are far from retirement; what do yo advice, is there a tech path they can follow, we in the IT world are used to learning new things, not happy about it mind you : ), but we understand; so is there anything you could advice, would be greatly appreciated.
@@salehalsheikh1586 - invest a small amount (if you're still young enough!) every month into a dividend yielding {something} that is within a TFSA. Compound growth.
@@salehalsheikh1586 Also remember, these same "obsolete" fears occured with almost every technological innovation. There's a huge shortage of engineers and neat deep learning tools aren't going to remove that need, the world of engineering is far too complex
@@groundhog4408 lmaooo i am both offended and flattered 🤣 funnily my lecturer asked me if I had used ChatGPT in an interim report i submit bc of "lots of big words stringed together" BRO this report is 30% of 25% of my final year i went over every word about 100 times optimising them since you are allowed like a couple sentences per headline 🤣
If it stops mid response you can tell it to kep going. Or go on. Or keep writing. One of those seem to work. Sometimes also pasting in the last few lines of code/text it wrote will help too and it will complete it.
My God, i just tried it to generate a blink code on and STM32...and it work wonders... i can see how this will speed my coding in the very near future. Thanx Hanqaqa for this.
I had it write an asynchronous webserver for esp32 including spiffs for saving and retrieving files. Had to do almost no cleanup and used more efficient code than what you would get compared to the examples when looking up things like "async webserver esp32" on search engines.
I got it to program connect 4 in python. I simply explained the rules of the game, how many spaces on the board, that it was a two player game, that you need to connect 4 in a row in any direction to win. It worked first time. There were a few problems with the way the x, y coords were set up and it had to be told A-G and 1-8 for matrix references, It had set them up as 1-8 and 1-6 but that was confusing. A couple of sentences and a few nudges in plain old English and there it was. It blew my mind too. It still needs some tweaking though, it can waste a lot of your time if you make your program longer that say 1kb in size.
I'm blown away by this. I tried this prompt "write a program for arduino for a calculator with 16 buttons and an LCD display" and it created the first part of the program to the point where number buttons basically function with the LCD (and that's it). I prompted it again: "please add buttons for addition, subtraction, division and multiplication" and it tried but came up short (adding some code that multiplies one number by 10. I'd say at least half of it is written though. At this point it seems to be a great shortcut to come up with snippets or examples for specific functionality that I might then include in a larger program. Very cool.
A bit more info: because I said 16 button calculator, it assumed a 4x4 button layout (logical) and laid the button code out so that it would actually look like a standard layout (of some sort). Amazing.
I'm glad I found a community of people already doing this here on this video because I did this project 3 weeks ago where I had Chad GPT create a website with HTML and make buttons that controlled in Arduino servo motor through a serial connection. I then put the website into an augmented reality environment and now you can use AR to control a microcontroller in the real world. It's literally building the bridge between digital and physical.
I plan to share it! I still have a few kinks to figure out: 1. My browser is showing up as transparent in my AR environment. I see it loaded in the environment but it's not showing opaque it's see-through basically. Then 2. My old laptop has a bad ethernet connection port. I'm getting myself a new laptop soon. Once I get past this issue I'll definitely be making a video and posting the link here
Cool video! From what I have read, the AI response is limited to 4000 "tokens" which are sort of like words, so asking it to play a song it will try to code the whole song and freeze once it hits its limit. If you ask it to play 10 seconds of a song instead, it will probably produce the code just fine. Very cool that you tried this and it worked! I struggle with Arduino code at times. Especially for the the seldom used modules that do not have a lot of examples online.
best way to see it is coders just got promoted to more of a manager type position of directions and corrections than just grinding out scripts all-day edit: its equivalent to when the printing press was invented but for scripting
Very nicely done video. Straight to the point and the overlay of the code and execution were great to understand what happened! Thank you so much for sharing this
Wow! This has such huge potential! Especially to derive methods within a program and quickly test theories, which is very time consuming. I have written huge programs that are complex and even filled a mega2560 to the point I had to modify the boot to get that last 4k access, and size is a huge factor so finding compact code is paramount. Looking forward to trying this out! Thanks for the preview!
Ha ha ha. Did it really? - I know that Craiyon AI sometimes does ridiculous things. But it only paints pictures by associating/imagining stuff based on the input and is not intended to think by its own whether the result makes sense beyond the realm of poetry.
@CYBERYOGI =CO= Windler I think the 2 extra beats are the spaces around it or something like that. The list of notes are not definitions of notes, they are the list of notes to play. You can see there are exactly 5 notes (the syllables) before a 0 in the list.
you can ask it to get the *current* temperature in Spain and it will write code that uses OpenWeatherMap. that's another impressive level of capability
Try writing "continue" if AI does not finish the text, because it's too large. Also you can try asking it to modify code like to fix things you have noticed not working correctly in your potentiometer case.
Yep. For longer stuff if I want to avoid it stalling out (I've only had intermittent success asking cGPT to 'continue') I just tell it to write in a compact style, use random 3 character variables only, and omit all comments. A bit of a headache to debug if it fails, BUT 99% of the time in that situation you can just explain the issue and it'll get fixed.
@@aaronkalahar-_-_- I had that shield years ago, but ended up throwing it away. For me it isn't useful to have the LCD always on top of the Arduino, sometimes I want the LCD screen a bit further or at an angle. So nowadays I simply use the regular LCD 16x2 screen with a i2c connection. That way I use less cables and can place the screen at different positions. I didn't like the limitation of having the screen always on top of an Arduino Uno.
@@aaronkalahar-_-_- yeah if you are just starting. Then a shield is a great option because connecting everything is much easier! Good luck with the shield!
when you ask for a very similar thing again it can assume the first wasn't ok and it can go off on a tangent. Best is to start a new chat because it keeps in mind everything that came before. It also has a max tokens output so sometimes you need to divide an assignment in steps and then ask for the steps separately.
It works very well since you know what to ask exactly This is what we call experience, knowing what to lookup exactly. When you have a bug in an application, as an experienced developer, you don’t just look for things randomly, but you think about all the ways it can go wrong (network, database, limits…) a junior thinks directly on the code. This is the difference with ChatGPT. It will not answer things that aren’t asked for exactly how to be answered
I still need to make a program for Arduino for a thermocouple and a solidstate relay. I need to have the temperature go up, stay on a temperature level, and then after some time ramp up again. The challenge probably would be to write down what i want in such a way that the openai program gets what i want to have. I will give it a try later this year. Greetings, Jeff
When ChatGPT hangs due to the length of its response, simply use clever ways to get around this. Such as asking it to write a short version of the song, ask it code in sections, such as write me a code that does this, add to the code so it does this etc... If you are someone who is naturally really good for example at finding exact search results due to your ability to not only ask the correct questions but to ask them in the correct ways.
It can do much more complex stuff especially when you add web server interfaces. And when it comes to errors just copy paste the error code and it will auto fix it. The not completed codes are because there is a response limit of 2500 characters
It is interesting that people keep feeding "produce code" requests into a black box tool which was trained on unknown dataset completely ignoring the fair warning of not running the code you do not understand completely. I wonder when will be the first public case of "ChatGPT produced JS code whacked by browser and stole my money"
It won't even provide examples of a fork bomb. I could probably convince it to by avoiding asking for it by name, but it just yelled at me for asking for a fork bomb so I'm not going to push my luck.
In my experience ( about one day ) the AI needs America to be asleep, otherwise it stops part way through a output process. Same thing durning USA night time, Day in the UK - it works. Also, you can say - continue output from ... whatever the last line shown was, it apologises for stopping and gives you the rest of the code. Impressive !
I have noticed that too. During the morning in Europe you can interact with the AI for as long as you want, then during the evening in Europe it gets much buggier.
I hadn't considered that, but it makes sense. As a total night owl in California the performance I've experienced is way faster than what I see from most youtube videos.
Likely it is all smoke and mirrors. When the AI fails to understands a question, everything is delegated to a callcenter that fixes parts by hand in the background without notice. Siri and Alexa work the same way (websearch MTurk aka "Amazon Mechanical Turk"). So when USA is asleep, nobody is there to reply (or censor if the AI is asked to do anything potentially harmful) and so advanced featured stay disabled.
I've tried it for signal processing in python. The basic FIR/IIR scripts worked, but EMD, PCA/ICA, Hilbert-Huang transform and wavelet transforms were all bugged. Dimensional mismatches, data type incompatibility or just plain unfinished code mid work. It's still a long way to be usable for anything more than the most basic things in my eyes. Maybe it will be better.
the thing it struggles with isn't difficulty but stuff that is uncommon, not many people do signal processing in python I assume so it doesn't have a big dataset to learn from
Its a tool - but the beneifts are impossible to deny. I think that it can allow hobbyists to up their game and even build MVPs for real-world applications.
I looked at the clock during this video and I realized wait that's not my clock that's this guys taskbar then I look at my own taskbar and its the exact same time. mind blown
for coding it is best to use a combination of OpenAI CODEX and ChatGPT, I figure they work very well together. just improve the GPTchat code with CODEX
And so ended humanities ability to write software. But seriously, Im super impressed, so many hours this is going to save me just to knock out a beginning boilerplate at the very least.
I had a personal project that has just been sat on my desk for months, because I couldnt deal with the context switching of getting back into arduino after being away from the platform for so many years and working mostly in web development these days. ChatGPT wrote a sound foundation for my firmware in a manner of minutes of chatting with it, I let it put in some placeholder functions for things because I felt it would be easier to just make some parts myself after all. But it can do a lot of things, if you specify what you are dealing with exactly it usually already knows the datasheet :D I kinda want to see what ChatGPT can do with git access. Imagine if you could just create tickets in JIRA like you do with everything else and then the bot would take things it had a good confidence in solving, amazing times and troublesome at the same time.
out standing ChatGPT video. 😎 There are several ChatGPT Arduino potentiometer LED example video. I wonder how many Arduino IDE example projects the AI can create? 🥳 Thank you.
Pretty neat but I think I know how it works. It uses slight variations of pre-existing library examples and looks for certain phrases in a certain order to build a flow chart to convert to a sketch. I suspect that this wouldn't work well with more complex logic. I couldn't imagine math heavy code (most of what I do) working with this. Meshing sensor data would probably crash it. I see some use in getting the basics to work quickly but that's what library examples are for. Somewhat impressive and great for beginners.
I agree with you - if you look at the comments, for some things it writes, they are the comments made by the original programmer (someone at Adafruit, etc.). So it has scraped all the existing code it can, it understands the basics, and it can put together a good start. But try to ask it to do something more complex with the logic and it can run into issues.
I'd love to see you put it to the test and tell us the results. Even if you have to reiterate gpt's code a few dozen times to get it working right on something more complex it would be nice to see a more advanced coder try to use it to the fullest extent.
This is the next generation of programming. Just saying what I want, and how I want it. The machine will do all the work and will automatically produce "finished products" just out of the box. There will be more "designers" and less programmers, the first pne doing more "creative" jobs and the others building the roots and the core of that technology
I bought a vga board for pi pico. It has a few additional extras onboard like sd card reader, additional mini usb etc. In order to get the pico to display to vga, the board has drivers written in c++(not my language of choice, I prefer python). I asked Chat GPT to convert the code to python and what do you know, it did it in about 20 seconds. I haven't tested it yet. I'm thinking maybe the vga board only accepts code written in c++ but watching this video, I'm maybe thinking I should check it out.
If it stops in mid response you can tell it it hasn't finished and it will continue. Also tell it has missed the header libraries and it should try to correct itself.
Garbage in, garbage out. All the bad code I've gotten out of it (besides some omissions of required libraries, as seen here in this video) were due entirely to my prompts not being specific enough, and there hasn't been anything that I haven't been able to get cGPT to debug on its own.
can you access the buzzer directly - I would love to hear it attempt to make chip music, having multiple tones at once - how would it tackle it? const int buzzerPin = 9; void setup() { // Set the buzzerPin as an output pinMode(buzzerPin, OUTPUT); } void loop() { // Play a C chord playC(); // Play a D chord playD(); // Play an E chord playE(); // Play a G chord playG(); } void playC() { // Play a C chord tone(buzzerPin, 262, 500); // C note delay(500); tone(buzzerPin, 330, 500); // E note delay(500); tone(buzzerPin, 392, 500); // G note delay(500); } void playD() { // Play a D chord tone(buzzerPin, 294, 500); // D note delay(500); tone(buzzerPin, 330, 500); // E note delay(500); tone(buzzerPin, 349, 500); // F note delay(500); } void playE() { // Play an E chord tone(buzzerPin, 330, 500); // E note delay(500); tone(buzzerPin, 349, 500); // F note delay(500); tone(buzzerPin, 392, 500); // G note delay(500); } void playG() { // Play a G chord tone(buzzerPin, 392, 500); // G note delay(500); tone(buzzerPin, 440, 500); // A note delay(500); tone(buzzerPin, 494, 500); // B note delay(500); }
I wonder how complicated a request you can make before CHAT glitches? In MidJourney, too many prompts, it starts ignoring some words. I'm guessing if you gave CHAT a list of 10 elements for a Sketch, Say multiple I2C sensors, a display, some calculations, buttons etch. when will it give up? I'm sure in the future a very clear, well formed series of elements could you have CHAT write a 100 element script? That would be CRAZY!!!!
im sure @hanqaqa knows this already but for anyone else watching: it gets stuck because there's a token limit. all you have to do is write Continue and it will keep going.
The music examples were probably trying to write example code for the entire length of the songs you requested. Classical music may have also not have been as successful since it wasn't specific enough. Maybe something similar to, "Write an Arduino program that plays the intro to 'Smoke on the Water'... etc" could be more successful (assuming that's what you were trying to do).
I've played with this and it writes some very good code. Of course, you need to double check it but when mistakes are found, it seems to get better at it. But the thing I liked most about it was, once you have good code, ChatGPT can port it to other micro controllers. I had some Arduino code ported to a PIC85. Now how cool is that?
Can you try if you can control a chip through spi which isn't used regularly. Something where there exists datasheet from, but is quite unknown further....
I like the idea of using Chat AI for Arduino, but these demos are just examples or known libraries. The average temp of Spain was a bit interesting, but that is more in line with something you would ask an Alexa. What if you start simple and just change the blink pin to 10? It would be more interesting to combine the pot example with the blink example. Ask it to write a program that will blink the LED connected to pin 10 at a rate determined by the pot input on A3 such that the blink rate is mapped from 100ms between pulses to always on. In other words the LED will blink from 10Hz to DC based on the pot position. Anyway, I know machine learning has come a long way. However, this video looks more like a search engine that will index Arduino examples and popular libraries with what you type based on the description in the code comments. The code from the examples is displayed to the user slowly as if it is being generated as an added effect.
@@twilightsparkle3157 I know GPT is capable enough. However these are really horrible examples if they did implement the Chat engine. If you think this video is a good example of machine learning, I am afraid it is you that lacks any idea. The examples I gave would have been an actual test of something other than the ready made Arduino libraries. It is not like I am claiming that it cannot happen. I merely stated it is a poor demo that could be done with an index tool. Give me a break, if I had such great capability the absolute last thing I would ask for is the blink example using default attributes. Useless.
I think it got stuck because the stuff was repetitive (the array with the notes) and being a predictive/statistical ai it needs variation in order to predict something complex (like it grinds out the stuff with the nice comments like its nothing)
Potentiometer code is wrong. It doesn't scale the value read (0-1023) down to a writable value (0-255). Hence the blinking at overflows. Edit: Oh, you were just about to mention it, hehe.
it gives you code that it is very confident about, which often doesnt work, and sometimes it just stops in mid response. a useful tool but it has to be watched very closely- like a junior employee who thinks too much of his abilities.
Good one! I think calling it a Junior employee is the most fitting description for the AI! At least while coding for embedded applications.
It is still new. The thing about AI is that it evolves incredibly quickly, and continues to grow and expand all the time.
when it stops, just ask it to continue. It's limited to the number of tokens it creates for each response.
the AI is not confident, I've spent considerable time working with it. It sees many ways to do things, the best thing to do is work on small portions of logic. it is also very good for generating boilerplate, and boilerplate sucks to write
You can instruct the chatbot to start answering at a certain point and get a long answer. Either you give the entire previous answer and say "continue from here" or you give the last few lines.
One key benefit I think your missing off chat gpt is the ability to have it refine things. So when you are missing a library just say something like "it looks like the library for... was not included" and 9 times out of 10 it will either give you the snippet of code or include the library. Involving chat get in the troubleshooting is half the beauty of it. It knows the exact context of your query so it's usually faster and getting you the correct answer then a Google search... unless it a decides to spout a bunch of nonsense. In which case it is usually still faster to guide it to the correct answer out just use the try again button to have it try something slightly different.
I found this too. It even knows the different solutions for different development environments !
The most impressive thing in this video is how powerful and convenient these Arduino libraries are!
It's really impressive. Almost all the work is done for you if you want to make a project using standard components.
@@TheCatherineCC the only downside to the libraries is that it makes it *too* easy and you don't have to struggle to learn the hard way which creates more neural pathways in your brain and basically makes you smarter.
@@drumbum7999 I suspect it's balanced out by the fact that someone new to this all can buy a $3 part off aliexpress that is fairly well documented and get things working in a fairly short amount of time, becoming passionate about coding and hardware.
It's not like 30 years ago where you had to spend some seriously frustrating time to get something stupid like a LCD screen working.
Not everyone is going to code firmware, but someone with "the bug" is far more likely to.
If a million monkeys will eventually write shakespeare, a million people playing with $3 ESP32s will make some cool shit too.
But yes, it feels way too easy in some ways.
After a long break, I got into writing actual code again playing with these things, and it's sooooo much easier.
IDEs don't suck, it seems literally everything is just on github, people are actually documenting their code making it easier for others to understand and build off it.
It really feels like a generational leap forward happened and society didn't realize it.
@@TheCatherineCC That's because most of the code for "standard components" is already out there on the internet and has been asked a million times. :)
The successive refinement is really something. If you generated Blinky, for instance, you can follow it up with: "Change the LED to pin 0" And it knows the prior conversation and improves on the result.
There is a limit for the length of the response. But you can type continue and it will finish the code. Also when you got the ADC DAC overflow, you could explain your issue and it will correct most likely. You can also paste your code and ask for help. In the video you asked for Arduino code, my guess is it would help if you specify the model.
Great video! As a hobbyist, having an “assistant” to deal with all the minutiae of connecting to a new sensor or display, or to just take the tedium out of making a UI frees up so much of my time and brainpower for actually making cool stuff instead of figuring out how to cajole the system into doing what I want. In that context, I don’t feel “obsoleted”, but rather enabled; it’s just a higher level of programming; the programming language has become conversational, iterative English. This is gonna be *so* great! 👍😃
I bet it would also be very helpful in debugging programs too: Give it the program, explain the problem, and ask it for the solution. That’d be interesting to see a video on as well.
(Next step, use the speech-to-text function on your computer to feed it input. I can see a day (very soon) when we can work with it all the way into even hardware debugging, probing a circuit and telling it what we find, so it can suggest the next thing to test in the debug tree :-)
Beware. "Creative" AIs tend to cheat and imagine nonsense when they don't know the answer, and possibly not even notice that they lie (because the output is assembled from guesswork based on correlations of things it read elsewhere). So it is not like asking a teacher, but more like asking a semi-educated imposter.
I love the word minutiae thanks for using it, didn't know it existed in english.
Spot on!
The only Thing that absolutely dominates is your talent in writing UA-cam titles!
This is amazing! The skill of knowing what to ask is also very important tho I think I'd have trouble describing what I need.
I was playing with this last night, and even telling GPT to integrate an Arduino with an automotive transmission (!!) it got it largely right! If nothing, it saved me hours of work by giving me a framework to start from, and I can just tweak it instead of starting from scratch. Boy am I glad I'm retiring shortly and don't have to worry so much about being put out of work by this.
I mean, for those who are far from retirement; what do yo advice, is there a tech path they can follow, we in the IT world are used to learning new things, not happy about it mind you : ), but we understand; so is there anything you could advice, would be greatly appreciated.
@@salehalsheikh1586 - invest a small amount (if you're still young enough!) every month into a dividend yielding {something} that is within a TFSA. Compound growth.
@@salehalsheikh1586 Also remember, these same "obsolete" fears occured with almost every technological innovation. There's a huge shortage of engineers and neat deep learning tools aren't going to remove that need, the world of engineering is far too complex
@@CamimalFPV that sounded like an ai response XD
@@groundhog4408 lmaooo i am both offended and flattered 🤣 funnily my lecturer asked me if I had used ChatGPT in an interim report i submit bc of "lots of big words stringed together"
BRO this report is 30% of 25% of my final year i went over every word about 100 times optimising them since you are allowed like a couple sentences per headline 🤣
If it stops mid response you can tell it to kep going. Or go on. Or keep writing. One of those seem to work. Sometimes also pasting in the last few lines of code/text it wrote will help too and it will complete it.
My God, i just tried it to generate a blink code on and STM32...and it work wonders... i can see how this will speed my coding in the very near future. Thanx Hanqaqa for this.
I had it write an asynchronous webserver for esp32 including spiffs for saving and retrieving files. Had to do almost no cleanup and used more efficient code than what you would get compared to the examples when looking up things like "async webserver esp32" on search engines.
This is blowing my brain in half.. As someone that just needs to program servos and motors.. it's like talking directly to the machine..
I got it to program connect 4 in python. I simply explained the rules of the game, how many spaces on the board, that it was a two player game, that you need to connect 4 in a row in any direction to win. It worked first time. There were a few problems with the way the x, y coords were set up and it had to be told A-G and 1-8 for matrix references, It had set them up as 1-8 and 1-6 but that was confusing. A couple of sentences and a few nudges in plain old English and there it was. It blew my mind too. It still needs some tweaking though, it can waste a lot of your time if you make your program longer that say 1kb in size.
I did one search on ChatGPT and now it's everywhere in my UA-cam
I'm going to try that for sure
The amount of content that ChatGPT is producing for youtube must be huge!
I'm blown away by this. I tried this prompt "write a program for arduino for a calculator with 16 buttons and an LCD display" and it created the first part of the program to the point where number buttons basically function with the LCD (and that's it). I prompted it again: "please add buttons for addition, subtraction, division and multiplication" and it tried but came up short (adding some code that multiplies one number by 10. I'd say at least half of it is written though. At this point it seems to be a great shortcut to come up with snippets or examples for specific functionality that I might then include in a larger program. Very cool.
A bit more info: because I said 16 button calculator, it assumed a 4x4 button layout (logical) and laid the button code out so that it would actually look like a standard layout (of some sort). Amazing.
I'm glad I found a community of people already doing this here on this video because I did this project 3 weeks ago where I had Chad GPT create a website with HTML and make buttons that controlled in Arduino servo motor through a serial connection. I then put the website into an augmented reality environment and now you can use AR to control a microcontroller in the real world. It's literally building the bridge between digital and physical.
Would like to see that as a video.
Please post a video and I will be your first viewer. Sounds amazing!
I plan to share it! I still have a few kinks to figure out: 1. My browser is showing up as transparent in my AR environment. I see it loaded in the environment but it's not showing opaque it's see-through basically. Then 2. My old laptop has a bad ethernet connection port. I'm getting myself a new laptop soon. Once I get past this issue I'll definitely be making a video and posting the link here
@@lordkylo Did you ask ChatGPT to help you with your first problem?
I tried with esp32.
I asked for a code to read from ina sensor and send the values to a tcp request.
Works like a charm without thinking.
Cool video! From what I have read, the AI response is limited to 4000 "tokens" which are sort of like words, so asking it to play a song it will try to code the whole song and freeze once it hits its limit. If you ask it to play 10 seconds of a song instead, it will probably produce the code just fine. Very cool that you tried this and it worked! I struggle with Arduino code at times. Especially for the the seldom used modules that do not have a lot of examples online.
best way to see it is coders just got promoted to more of a manager type position of directions and corrections than just grinding out scripts all-day
edit: its equivalent to when the printing press was invented but for scripting
So a text parser to C code translator. Did that for Baxter in the 90's. For analyzing blood. It was a translator, shy of a full compiler.
Great video! Didnt know ChatGPT could do this as well 🤯
Very nicely done video. Straight to the point and the overlay of the code and execution were great to understand what happened! Thank you so much for sharing this
Wow! This has such huge potential! Especially to derive methods within a program and quickly test theories, which is very time consuming.
I have written huge programs that are complex and even filled a mega2560 to the point I had to modify the boot to get that last 4k access, and size is a huge factor so finding compact code is paramount.
Looking forward to trying this out! Thanks for the preview!
Used it last week to create a midi note converter. It gave me at least 80% of the eventual code that I used
Word. It's the difference between planting some trees and smelting some iron to make an axe... or just going to the lumber yard / hardware store.
It has literally saved me hours doing arduino code
It was humming "classical music" through the speaker.
In other words it was humming the syllables with intonation matching US English accented speech.
Ha ha ha. Did it really? - I know that Craiyon AI sometimes does ridiculous things. But it only paints pictures by associating/imagining stuff based on the input and is not intended to think by its own whether the result makes sense beyond the realm of poetry.
@@cyberyogicowindler2448 he asked it to play classical music through the speaker, and it did. I think it was around 16:30
@CYBERYOGI =CO= Windler I think the 2 extra beats are the spaces around it or something like that. The list of notes are not definitions of notes, they are the list of notes to play. You can see there are exactly 5 notes (the syllables) before a 0 in the list.
Why are you not getting much engagement I mean these kind of content must get more engagement than showbiz gossips here in UA-cam?
you can ask it to get the *current* temperature in Spain and it will write code that uses OpenWeatherMap. that's another impressive level of capability
Try writing "continue" if AI does not finish the text, because it's too large. Also you can try asking it to modify code like to fix things you have noticed not working correctly in your potentiometer case.
Yep. For longer stuff if I want to avoid it stalling out (I've only had intermittent success asking cGPT to 'continue') I just tell it to write in a compact style, use random 3 character variables only, and omit all comments. A bit of a headache to debug if it fails, BUT 99% of the time in that situation you can just explain the issue and it'll get fixed.
Great video man! Greetings from Minnesota. ❄️
Thanks man! I plan to make a similar video on ESP32 this week!
@@Hanqaqa Very cool!
What are your thoughts on the 1602 LCD Keypad Shield?
@@aaronkalahar-_-_- I had that shield years ago, but ended up throwing it away.
For me it isn't useful to have the LCD always on top of the Arduino, sometimes I want the LCD screen a bit further or at an angle. So nowadays I simply use the regular LCD 16x2 screen with a i2c connection. That way I use less cables and can place the screen at different positions.
I didn't like the limitation of having the screen always on top of an Arduino Uno.
@@Hanqaqa I just got mine in the mail. I see what you mean by the limitation.
I’m just starting so I thought it’d be worth a shot!
@@aaronkalahar-_-_- yeah if you are just starting. Then a shield is a great option because connecting everything is much easier!
Good luck with the shield!
when you ask for a very similar thing again it can assume the first wasn't ok and it can go off on a tangent. Best is to start a new chat because it keeps in mind everything that came before. It also has a max tokens output so sometimes you need to divide an assignment in steps and then ask for the steps separately.
I normally ask for a tutorial style, and a list of each step. That way I can ask it to go to each step.
It works very well since you know what to ask exactly
This is what we call experience, knowing what to lookup exactly.
When you have a bug in an application, as an experienced developer, you don’t just look for things randomly, but you think about all the ways it can go wrong (network, database, limits…) a junior thinks directly on the code.
This is the difference with ChatGPT. It will not answer things that aren’t asked for exactly how to be answered
I still need to make a program for Arduino for a thermocouple and a solidstate relay. I need to have the temperature go up, stay on a temperature level, and then after some time ramp up again. The challenge probably would be to write down what i want in such a way that the openai program gets what i want to have.
I will give it a try later this year.
Greetings,
Jeff
The responce has a length top out. If it cuts you off ask it to finish and it will continue.
When ChatGPT hangs due to the length of its response, simply use clever ways to get around this. Such as asking it to write a short version of the song, ask it code in sections, such as write me a code that does this, add to the code so it does this etc... If you are someone who is naturally really good for example at finding exact search results due to your ability to not only ask the correct questions but to ask them in the correct ways.
few days ago i also try the AI to wrote me a C# script for a game,and darn, it doing pretty good and fast.
It can do much more complex stuff especially when you add web server interfaces.
And when it comes to errors just copy paste the error code and it will auto fix it.
The not completed codes are because there is a response limit of 2500 characters
Great video! Can’t wait to use this info
It is interesting that people keep feeding "produce code" requests into a black box tool which was trained on unknown dataset completely ignoring the fair warning of not running the code you do not understand completely. I wonder when will be the first public case of "ChatGPT produced JS code whacked by browser and stole my money"
It won't even provide examples of a fork bomb. I could probably convince it to by avoiding asking for it by name, but it just yelled at me for asking for a fork bomb so I'm not going to push my luck.
It,s conversational ! So it remembers what you ask ! Just type ADD LIBRARY, CONTINUE to finish...etc.
Happy 2023 - saludos desde España!
Crazy, my arduino knowledge is not better than a bot in anyway.
just seems like an extra smart google search of github to me. nothing more.
In my experience ( about one day ) the AI needs America to be asleep, otherwise it stops part way through a output process. Same thing durning USA night time, Day in the UK - it works.
Also, you can say - continue output from ... whatever the last line shown was, it apologises for stopping and gives you the rest of the code. Impressive !
I have noticed that too. During the morning in Europe you can interact with the AI for as long as you want, then during the evening in Europe it gets much buggier.
I hadn't considered that, but it makes sense. As a total night owl in California the performance I've experienced is way faster than what I see from most youtube videos.
Likely it is all smoke and mirrors. When the AI fails to understands a question, everything is delegated to a callcenter that fixes parts by hand in the background without notice. Siri and Alexa work the same way (websearch MTurk aka "Amazon Mechanical Turk"). So when USA is asleep, nobody is there to reply (or censor if the AI is asked to do anything potentially harmful) and so advanced featured stay disabled.
I've tried it for signal processing in python. The basic FIR/IIR scripts worked, but EMD, PCA/ICA, Hilbert-Huang transform and wavelet transforms were all bugged. Dimensional mismatches, data type incompatibility or just plain unfinished code mid work. It's still a long way to be usable for anything more than the most basic things in my eyes. Maybe it will be better.
There is a word limit for answers, if you type continue, it will complete the answer
the thing it struggles with isn't difficulty but stuff that is uncommon, not many people do signal processing in python I assume so it doesn't have a big dataset to learn from
Its a tool - but the beneifts are impossible to deny. I think that it can allow hobbyists to up their game and even build MVPs for real-world applications.
I looked at the clock during this video and I realized wait that's not my clock that's this guys taskbar then I look at my own taskbar and its the exact same time. mind blown
for coding it is best to use a combination of OpenAI CODEX and ChatGPT, I figure they work very well together. just improve the GPTchat code with CODEX
When it gets stuck you can try to make it keep going by saying “go on” it had a char limit
or 'continue'.
It is absolutely amazing. I fkn love it!
This was informative. This is impressive.
And so ended humanities ability to write software. But seriously, Im super impressed, so many hours this is going to save me just to knock out a beginning boilerplate at the very least.
I had a personal project that has just been sat on my desk for months, because I couldnt deal with the context switching of getting back into arduino after being away from the platform for so many years and working mostly in web development these days. ChatGPT wrote a sound foundation for my firmware in a manner of minutes of chatting with it, I let it put in some placeholder functions for things because I felt it would be easier to just make some parts myself after all. But it can do a lot of things, if you specify what you are dealing with exactly it usually already knows the datasheet :D I kinda want to see what ChatGPT can do with git access. Imagine if you could just create tickets in JIRA like you do with everything else and then the bot would take things it had a good confidence in solving, amazing times and troublesome at the same time.
whenever it gets stuck just type continue and it will keep going
out standing ChatGPT video. 😎 There are several ChatGPT Arduino potentiometer LED example video. I wonder how many Arduino IDE example projects the AI can create? 🥳 Thank you.
Pretty neat but I think I know how it works. It uses slight variations of pre-existing library examples and looks for certain phrases in a certain order to build a flow chart to convert to a sketch. I suspect that this wouldn't work well with more complex logic. I couldn't imagine math heavy code (most of what I do) working with this. Meshing sensor data would probably crash it. I see some use in getting the basics to work quickly but that's what library examples are for. Somewhat impressive and great for beginners.
I agree with you - if you look at the comments, for some things it writes, they are the comments made by the original programmer (someone at Adafruit, etc.). So it has scraped all the existing code it can, it understands the basics, and it can put together a good start. But try to ask it to do something more complex with the logic and it can run into issues.
I'd love to see you put it to the test and tell us the results. Even if you have to reiterate gpt's code a few dozen times to get it working right on something more complex it would be nice to see a more advanced coder try to use it to the fullest extent.
This is the next generation of programming. Just saying what I want, and how I want it. The machine will do all the work and will automatically produce "finished products" just out of the box. There will be more "designers" and less programmers, the first pne doing more "creative" jobs and the others building the roots and the core of that technology
no its not, its programming for people who dont know how to program ..if that the future, we're fuked
@@mtraven23 that's the reason I said designer and not programmer.
@@gymroskabachulskichorizins8813 this is not the future. this is s recipe for disaster.
I bought a vga board for pi pico. It has a few additional extras onboard like sd card reader, additional mini usb etc. In order to get the pico to display to vga, the board has drivers written in c++(not my language of choice, I prefer python). I asked Chat GPT to convert the code to python and what do you know, it did it in about 20 seconds. I haven't tested it yet. I'm thinking maybe the vga board only accepts code written in c++ but watching this video, I'm maybe thinking I should check it out.
Give us a update & tell us how it does.
@@calicoesblue4703 Will do. I'll try it this week and let you know how I got on.
Got something a bit different:
#include
#include
// Define the piezo buzzer pin
#define PIEZO_PIN 9
// Create a Tone object for playing notes
Tone piezo;
// Smoke on the Water melody
// Notes are given in half tones above A4 (440 Hz)
// R stands for a rest
int melody[] = {
0, // A4
2, // B4
4, // C5
5, // D5
7, // E5
9, // F5
11, // G5
12, // A5
14, // B5
16, // C6
17, // D6
19, // E6
21, // F6
23, // G6
24, // A6
26, // B6
28, // C7
29, // D7
31, // E7
33, // F7
35, // G7
36, // A7
38, // B7
40, // C8
41, // D8
43, // E8
45, // F8
47, // G8
48, // A8
50, // B8
52, // C9
53, // D9
55 // E9
};
// Smoke on the Water tempo
// 4/4 time, quarter notes at 140 bpm
int tempo[] = {
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8
};
void setup() {
// Set the piezo buzzer pin as an output
pinMode(PIEZO_PIN, OUTPUT);
}
void loop() {
// Play the "Smoke on the Water" melody
for (int i = 0; i < sizeof(melody) / sizeof(int); i++) {
// If the current note is a rest, delay for the appropriate amount of time
if (melody[i] == -1) {
delay(tempo[i] * 6);
}
// Otherwise, play the note
else {
piezo.play(piezo.note(melody[i], 1, 0), tempo[i] * 6);
delay(tempo[i] * 6);
}
}
}
If it stops in mid response you can tell it it hasn't finished and it will continue. Also tell it has missed the header libraries and it should try to correct itself.
Its really mind boggling
there is a lot of bad code in chatGPT, but it is a good effort and it has some good pointers to make your life easier
Garbage in, garbage out. All the bad code I've gotten out of it (besides some omissions of required libraries, as seen here in this video) were due entirely to my prompts not being specific enough, and there hasn't been anything that I haven't been able to get cGPT to debug on its own.
so interesting, thanks for making this video!
15:00 type Continue and ChatGPT will continue writing the code, song, story or whatever.
Great video
Muchas gracias por el vídeo, brutal!
Gracias por verlo!
The message length limit on the ChatGPT website is 8192 characters.
Maybe "Smoke on the water" intro only.
Hola amigo! This is super helpful. Thanks!
it didnt get stuck, it can only output a certain amount of characters. You can type "Continue" to have it print the rest of the code
Both awesome and a bit scary. 😁
can you access the buzzer directly - I would love to hear it attempt to make chip music, having multiple tones at once - how would it tackle it?
const int buzzerPin = 9;
void setup() {
// Set the buzzerPin as an output
pinMode(buzzerPin, OUTPUT);
}
void loop() {
// Play a C chord
playC();
// Play a D chord
playD();
// Play an E chord
playE();
// Play a G chord
playG();
}
void playC() {
// Play a C chord
tone(buzzerPin, 262, 500); // C note
delay(500);
tone(buzzerPin, 330, 500); // E note
delay(500);
tone(buzzerPin, 392, 500); // G note
delay(500);
}
void playD() {
// Play a D chord
tone(buzzerPin, 294, 500); // D note
delay(500);
tone(buzzerPin, 330, 500); // E note
delay(500);
tone(buzzerPin, 349, 500); // F note
delay(500);
}
void playE() {
// Play an E chord
tone(buzzerPin, 330, 500); // E note
delay(500);
tone(buzzerPin, 349, 500); // F note
delay(500);
tone(buzzerPin, 392, 500); // G note
delay(500);
}
void playG() {
// Play a G chord
tone(buzzerPin, 392, 500); // G note
delay(500);
tone(buzzerPin, 440, 500); // A note
delay(500);
tone(buzzerPin, 494, 500); // B note
delay(500);
}
I wonder how complicated a request you can make before CHAT glitches? In MidJourney, too many prompts, it starts ignoring some words. I'm guessing if you gave CHAT a list of 10 elements for a Sketch, Say multiple I2C sensors, a display, some calculations, buttons etch. when will it give up? I'm sure in the future a very clear, well formed series of elements could you have CHAT write a 100 element script? That would be CRAZY!!!!
It can be done. You just have to ask part by part then ask to build the complete code without commenting. It worked for me while using NodeMCU.
yes this is the follow up we need
Please use a high pass filter on your audio or move your mic to avoid all the desk noise and rumble.
You can say continue when it stops talking or coding mid sentence and it will pick up where it left off
im sure @hanqaqa knows this already but for anyone else watching: it gets stuck because there's a token limit. all you have to do is write Continue and it will keep going.
I use GPT3 to write employee feedback. It saves me hours of word smithing.
7:20 He didn't assumed the temp. It has all wikipedia contents and many other open ressources during his learning back in 2021.
Muy interesante! Lo probaré sin duda🥵
The music examples were probably trying to write example code for the entire length of the songs you requested. Classical music may have also not have been as successful since it wasn't specific enough. Maybe something similar to, "Write an Arduino program that plays the intro to 'Smoke on the Water'... etc" could be more successful (assuming that's what you were trying to do).
Liked and subbed friend! Very amazing!
I've played with this and it writes some very good code. Of course, you need to double check it but when mistakes are found, it seems to get better at it. But the thing I liked most about it was, once you have good code, ChatGPT can port it to other micro controllers. I had some Arduino code ported to a PIC85. Now how cool is that?
Can you try if you can control a chip through spi which isn't used regularly.
Something where there exists datasheet from, but is quite unknown further....
when results get truncated, just say "go on" and it completes the writing
I like the idea of using Chat AI for Arduino, but these demos are just examples or known libraries. The average temp of Spain was a bit interesting, but that is more in line with something you would ask an Alexa.
What if you start simple and just change the blink pin to 10? It would be more interesting to combine the pot example with the blink example. Ask it to write a program that will blink the LED connected to pin 10 at a rate determined by the pot input on A3 such that the blink rate is mapped from 100ms between pulses to always on. In other words the LED will blink from 10Hz to DC based on the pot position.
Anyway, I know machine learning has come a long way. However, this video looks more like a search engine that will index Arduino examples and popular libraries with what you type based on the description in the code comments. The code from the examples is displayed to the user slowly as if it is being generated as an added effect.
@@twilightsparkle3157 I know GPT is capable enough. However these are really horrible examples if they did implement the Chat engine. If you think this video is a good example of machine learning, I am afraid it is you that lacks any idea. The examples I gave would have been an actual test of something other than the ready made Arduino libraries. It is not like I am claiming that it cannot happen. I merely stated it is a poor demo that could be done with an index tool.
Give me a break, if I had such great capability the absolute last thing I would ask for is the blink example using default attributes. Useless.
If it stops you need to tell it to go on and it will finish it, then tell it what bugs you get and it will fix them
Would like to see that database behind it
I think it got stuck because the stuff was repetitive (the array with the notes) and being a predictive/statistical ai it needs variation in order to predict something complex (like it grinds out the stuff with the nice comments like its nothing)
could you ask the bot setup head tracking code for arduino?
as a scaffolding tool more than enough
Incredible 👍
I think this has potential to give the new neuron-based fpgas a good chance of feeling superior to us mortals.
you can type "next lines" when it gets "stuck"
Looks like it mostly spits out example code.
When I have a bug in my code, I can ask ChatGPT to look it over and suggest fixes.
Potentiometer code is wrong. It doesn't scale the value read (0-1023) down to a writable value (0-255). Hence the blinking at overflows. Edit: Oh, you were just about to mention it, hehe.
Ask It to code Midi over USB, I supose it will fail...I have tryed and the answer is no good.
Can you ask it to do bad things? Like make a wifi sniffer that can brake passwords or do other illegal things? Would make a great video right :)
You can try, though you risk being flagged and/or banned. I got a couple warnings for asking for offensive song lyrics. It's got pretty good filters.
Just type continue if the a.i stops writing
When it get stuck, youst type CONTINUE !