Building an Arduino library using ChatGPT,  what do you think ?  - Page 1
Forum section: electronics / general

author: YTusername
author_rank: Regular Contributor
timestamp: September 04, 2023, 08:07:26 am
content: Adafruit published a record of Ladyada creating Arduino library for an I2C sensor, vcnl4020. The steps she showed were amazing, she was able to make the ChatGPT extracting and building the Enums and Definitions of registers and flags. Moreover, she instructed it to use Adafruit_BusIO style while building the library. I don't like usually to exaggerate things, but this is really amazing.However, as Ladyada mentioned several times, you can not trust 100% the output, but for me it is indeed an assistant tool for extracting the Enums and Definitions and building the skelton at least.The video:

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 04, 2023, 08:28:57 am
content: Thanks for the warning.

author: retiredfeline
author_rank: Frequent Contributor
timestamp: September 04, 2023, 08:53:17 am
content: I'm not surprised. ChatGPT can make up things. I asked it regarding commands for building a flatpak and it make up some commands that never existed or perhaps (to be charitable) were deprecated. I would not trust software built by it. For now, just use it for making up stories, like advertising copy, or where you intend to double check its assertions anyway.

author: YTusername
author_rank: Regular Contributor
timestamp: September 04, 2023, 09:15:17 am
content: Quote from: retiredfeline on September 04, 2023, 08:53:17 amYes, I don't trust its output either, but within the video, Ladyada used a PDF parser plugin and asked the ChatGPT to parse the sensor datasheet. I still find the time I will spend in commanding it and reviewing its output may be equal to building the library from zero, but It is giving an indicator of a new assistant firmware development tool that can be helpful in some cases.

author: radiolistener
author_rank: Super Contributor
timestamp: September 04, 2023, 10:44:30 am
content: it can write some small function and it can works. But if you want to change its behavior it's hard task for chat-gpt, it always trying to keep original code and attempts to apply your requested changes, but often these changes are wrong and if you explain what is wrong and how to fix it, chat-gpt just give you stupid solutions and there is no way to learn it how to do. So, technically it is useless for coding.It can be useful for large project algorythm analysis and finding the point in the code which is interested for you. But unfortunately chat-gpt cannot accept large code. So it also useless for analysis...You can use it as a startup when you want to learn some new algorithm, You can ask chat-gpt and it often provide useful portions of info which you can check in literature. But don't belive it, it often give you non existent links and incorrect answers.chat-gpt is some kind of more smart google search which can combine and modify information. It is stupid, but has a lot of info in database and you can find it with different requests...

author: dobsonr741
author_rank: Frequent Contributor
timestamp: September 04, 2023, 03:21:12 pm
content: LadyAda said it right: “it allows to use my higher functions”. It’s enough for me, and will use AI in coding whenever I can.

author: KE5FX
author_rank: Super Contributor
timestamp: September 04, 2023, 05:01:06 pm
content: The #1 programming language in 2010 was Java.The #1 programming language in 2020 was Python.The #1 programming language in 2030 will be English.Don't argue, just bookmark the post and let's take it back up in 2030.

author: NorthGuy
author_rank: Super Contributor
timestamp: September 04, 2023, 06:23:34 pm
content: Certainly, it's only a matter of time until these things surpass humans in every respect.Will this help us, or will this make humans obsolete? That is the question.

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 04, 2023, 10:45:59 pm
content: I'm sure it's very useful compared to going there:https://github.com/beegee-tokyo/VCNL4020C-Arduino

author: magic
author_rank: Super Contributor
timestamp: September 05, 2023, 07:18:13 am
content: "Lady Ada" lives off people who have no clue and want results with no effort.Of course she will be making videos like this

author: magic
author_rank: Super Contributor
timestamp: September 05, 2023, 07:19:52 am
content: Quote from: KE5FX on September 04, 2023, 05:01:06 pmChinese in 2040

author: artag
author_rank: Super Contributor
timestamp: September 05, 2023, 07:56:48 am
content: I think Johnson would have the measure of ChatGPT.“Sir, a woman's preaching is like a dog's walking on his hind legs. It is not done well; but you are surprised to find it done at all.”― Samuel JohnsonApologies for the incidental misogyny

author: YTusername
author_rank: Regular Contributor
timestamp: September 05, 2023, 07:59:43 am
content: Quote from: SiliconWizard on September 04, 2023, 10:45:59 pmI'm sure that soon managers and recruiters will start to say. "What is this!! AI can build it better than you". Maybe some already started to say so in software industry, I don't know.Quote from: NorthGuy on September 04, 2023, 06:23:34 pmI do believe it is not as dangerous as making humans obsolete. No machine in the world will have the cognitive skills like humans, but as engineers, we need to be aware of AI and not ignore it like what some Analog engineers did when digital electronics arose, just like when any new technology arose.

author: artag
author_rank: Super Contributor
timestamp: September 05, 2023, 08:00:44 am
content: Quote from: KE5FX on September 04, 2023, 05:01:06 pmBut it's such an interesting topic !

author: agehall
author_rank: Frequent Contributor
timestamp: September 05, 2023, 03:26:38 pm
content: I’ve played quite a bit with GitHub Copilot over the last few weeks. It is far from perfect but I do feel it makes me a ton more productive. Do I trust the output 100%? Of course not. But it gives me a good starting point for a lot of things and saves me a lot of googling to find out how various functions and/or libraries work.The way I see it, AI won’t replace the programmer anytime soon, but it will allow me to focus on the important stuff instead of silly things. Think of it as pair-programming with a newbie that is enthusiastically suggesting code - it is often somewhat right but you still have to be on your toes and correct things.

author: coppice
author_rank: Super Contributor
timestamp: September 05, 2023, 03:32:02 pm
content: Quote from: YTusername on September 04, 2023, 08:07:26 amThe steps she took were extensively studied and rehearsed in advanced, to figure out what, mostly by luck, produces something positive.

author: KE5FX
author_rank: Super Contributor
timestamp: September 05, 2023, 05:48:10 pm
content: Quote from: YTusername on September 05, 2023, 07:59:43 amLee Se-dol unavailable for comment.

author: coppice
author_rank: Super Contributor
timestamp: September 05, 2023, 06:05:49 pm
content: Quote from: YTusername on September 05, 2023, 07:59:43 amOf course no commercial machine will have cognitive skills like humans. If they are that limited they would serve no commercial purpose. They need to outpace us, either in speed, depth, or reliabilty.

author: liaifat85
author_rank: Regular Contributor
timestamp: September 11, 2023, 08:19:08 am
content: I am yet to see the video. But from your description, I agree with Lady Ada. I made a tutorial on how to make an Arduino library with ChatGPT. I just commanded it to write a library for an RGB LED. It worked. But for other complicated devices, I have some negative experiences.

author: radiolistener
author_rank: Super Contributor
timestamp: September 11, 2023, 10:50:24 am
content: Quote from: liaifat85 on September 11, 2023, 08:19:08 amI think this is because someone who worked on chat-gpt development is just predicted that someone will ask to write a simple arduino code for LED blinking and provided some ready code and ways on how to customize that code. So it works like cmake, you're just set some options and it configure build of the project, but if you're trying to set some option which doesn't exists in the project, it fails and you won't be able to get cmake to implement the missing codeSo, chat-gpt looks like more smart code generator, but it can provide existing solutions and cannot create something new, which is not added to it's database

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 11, 2023, 09:49:05 pm
content: Quote from: magic on September 05, 2023, 07:19:52 amYou're assuming people will be speaking any language at all by 2040.

author: fourfathom
author_rank: Super Contributor
timestamp: September 12, 2023, 12:03:28 am
content: Quote from: magic on September 05, 2023, 07:18:13 amJust for the record, I *strongly* disagree with the sentiment you are expressing.

author: KE5FX
author_rank: Super Contributor
timestamp: September 12, 2023, 12:35:14 am
content: Same here.

author: HarryDoPECC
author_rank: Regular Contributor
timestamp: September 12, 2023, 04:26:00 am
content: "Building an ---- library using Autocomplete, what do you think"Lets all remember that's all this tech is - a very sophisticated, somewhat context-aware predictor of the most likely next character/token/pixel based on its training set. There is nothing more there. Anyone who says otherwise should be asked to provide evidence.So it's not surprising that it can autocomplete a pretty circumscribed request that is heavily represented on the internet "..an Arduino library"Compare however how badly it does on a more open request that is nevertheless heavily documented on the web "... win at chess"I most like the view that says "AI" is asmart solution for dumb problems. There are lots of time-consuming dumb problems - software libraries are usually in that category, they rarely break new ground.If you have a smart, subtle or difficult problem, "AI"/autocomplete is not going to help much. So smart, subtle people have little to fear or be concerned about. Dumb people OTOH.....

author: NorthGuy
author_rank: Super Contributor
timestamp: September 12, 2023, 01:09:59 pm
content: Quote from: HarryDoPECC on September 12, 2023, 04:26:00 amIt is based on a neural network. Isn't it. So, deep down it is based on the same principals as human brain. Dog's brain is the same but smaller, so they're dumber than humans. At present time AI is much smarter than a dog, but is not as smart as humans. But as its brain grows 100 times (or million times), there's no doubts it'll surpasses human brain at some point. Most likely there are private installations somewhere which already have.Quote from: HarryDoPECC on September 12, 2023, 04:26:00 amI have read articles about this. It mounts pieces on top of each other, makes moves which are not allowed by rules. This is not a behaviour you would expect of a machine. This is not as dumb as a dog - it understand that there is a chessboard and pieces. Rather, it behaves like a child. If you saw a small child doing this, you wouldn't say the child was dumb. That's just a child who will learn with time, may even become a great chess master. Same with AI. It must be trained. After years of training it may learn to play chess even though nobody programmed it for this exact purpose. Same as humans.Quote from: HarryDoPECC on September 12, 2023, 04:26:00 amNot yet. But as the brain grows and after years of learning, who knows. After it surpasses humans by some margin, there's no way we can make it solve our dumb problems. Higher intelligence will never be sub-servant to its dumber creators.

author: coppice
author_rank: Super Contributor
timestamp: September 12, 2023, 01:13:29 pm
content: Quote from: NorthGuy on September 12, 2023, 01:09:59 pmIts based on atoms, isn't it? So, deep down it is based on the same principals as bull shit.

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 13, 2023, 12:59:33 am
content: Quote from: coppice on September 12, 2023, 01:13:29 pm

author: radiolistener
author_rank: Super Contributor
timestamp: September 14, 2023, 10:25:49 am
content: Quote from: coppice on September 12, 2023, 01:13:29 pm

author: lapm
author_rank: Frequent Contributor
timestamp: September 14, 2023, 06:02:48 pm
content: Interesting experiment, but you definitely need experienced embedded coder to quality check anything chatGPT produces.