Author Topic: Building an Arduino library using ChatGPT, what do you think ?  (Read 3121 times)

0 Members and 1 Guest are viewing this topic.

Offline YTusernameTopic starter

  • Regular Contributor
  • *
  • Posts: 83
  • Country: tr
    • Atadiat
Building an Arduino library using ChatGPT, what do you think ?
« on: September 04, 2023, 08:07:26 am »
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:


« Last Edit: September 04, 2023, 09:10:22 am by YTusername »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 6264
  • Country: fi
    • My home page and email address
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #1 on: September 04, 2023, 08:28:57 am »
Thanks for the warning.
 

Online retiredfeline

  • Frequent Contributor
  • **
  • Posts: 539
  • Country: au
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #2 on: September 04, 2023, 08:53:17 am »
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.
 

Offline YTusernameTopic starter

  • Regular Contributor
  • *
  • Posts: 83
  • Country: tr
    • Atadiat
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #3 on: September 04, 2023, 09:15:17 am »
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.

Yes, 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.
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3377
  • Country: ua
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #4 on: September 04, 2023, 10:44:30 am »
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... :)
« Last Edit: September 04, 2023, 10:49:35 am by radiolistener »
 
The following users thanked this post: YTusername

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 674
  • Country: us
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #5 on: September 04, 2023, 03:21:12 pm »
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.
 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 1894
  • Country: us
    • KE5FX.COM
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #6 on: September 04, 2023, 05:01:06 pm »
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.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3146
  • Country: ca
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #7 on: September 04, 2023, 06:23:34 pm »
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.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14481
  • Country: fr
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #8 on: September 04, 2023, 10:45:59 pm »
I'm sure it's very useful compared to going there: https://github.com/beegee-tokyo/VCNL4020C-Arduino
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #9 on: September 05, 2023, 07:18:13 am »
"Lady Ada" lives off people who have no clue and want results with no effort.

Of course she will be making videos like this 8)
 
The following users thanked this post: Dave, JPortici, SiliconWizard

Offline magic

  • Super Contributor
  • ***
  • Posts: 6779
  • Country: pl
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #10 on: September 05, 2023, 07:19:52 am »
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.
Chinese in 2040 :-DD
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1075
  • Country: gb
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #11 on: September 05, 2023, 07:56:48 am »
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 Johnson


Apologies for the incidental misogyny
 

Offline YTusernameTopic starter

  • Regular Contributor
  • *
  • Posts: 83
  • Country: tr
    • Atadiat
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #12 on: September 05, 2023, 07:59:43 am »
I'm sure it's very useful compared to going there: https://github.com/beegee-tokyo/VCNL4020C-Arduino

I'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  ;D.

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.

I 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.
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1075
  • Country: gb
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #13 on: September 05, 2023, 08:00:44 am »
Don't argue, just bookmark the post and let's take it back up in 2030.

But it's such an interesting topic !
 

Offline agehall

  • Frequent Contributor
  • **
  • Posts: 383
  • Country: se
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #14 on: September 05, 2023, 03:26:38 pm »
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.
 
The following users thanked this post: YTusername

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8651
  • Country: gb
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #15 on: September 05, 2023, 03:32:02 pm »
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.
The steps she took were extensively studied and rehearsed in advanced, to figure out what, mostly by luck, produces something positive.
 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 1894
  • Country: us
    • KE5FX.COM
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #16 on: September 05, 2023, 05:48:10 pm »
I do believe it is not as dangerous as making humans obsolete. No machine in the world will have the cognitive skills like humans

Lee Se-dol unavailable for comment.  :popcorn:
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8651
  • Country: gb
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #17 on: September 05, 2023, 06:05:49 pm »
I do believe it is not as dangerous as making humans obsolete. No machine in the world will have the cognitive skills like humans.
Of 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.
 

Offline liaifat85

  • Regular Contributor
  • *
  • !
  • Posts: 172
  • Country: bd
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #18 on: September 11, 2023, 08:19:08 am »
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. 
 

Online radiolistener

  • Super Contributor
  • ***
  • Posts: 3377
  • Country: ua
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #19 on: September 11, 2023, 10:50:24 am »
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.

I 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 code  :)

So, 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
« Last Edit: September 11, 2023, 10:57:20 am by radiolistener »
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14481
  • Country: fr
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #20 on: September 11, 2023, 09:49:05 pm »
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.
Chinese in 2040 :-DD

You're assuming people will be speaking any language at all by 2040. :-DD
 
The following users thanked this post: magic

Offline fourfathom

  • Super Contributor
  • ***
  • Posts: 1884
  • Country: us
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #21 on: September 12, 2023, 12:03:28 am »
"Lady Ada" lives off people who have no clue and want results with no effort.

Just for the record, I *strongly* disagree with the sentiment you are expressing.
We'll search out every place a sick, twisted, solitary misfit might run to! -- I'll start with Radio Shack.
 

Offline KE5FX

  • Super Contributor
  • ***
  • Posts: 1894
  • Country: us
    • KE5FX.COM
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #22 on: September 12, 2023, 12:35:14 am »
Same here.
 

Offline HarryDoPECC

  • Regular Contributor
  • *
  • Posts: 63
  • Country: au
    • The Dawn of Personal Electronic Calculators and Computers
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #23 on: September 12, 2023, 04:26:00 am »
"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 a smart 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.....
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3146
  • Country: ca
Re: Building an Arduino library using ChatGPT, what do you think ?
« Reply #24 on: September 12, 2023, 01:09:59 pm »
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.

It 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.

Compare however how badly it does on a more open request that is nevertheless heavily documented on the web  "... win at chess"

I 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.

I most like the view that says "AI" is a smart solution for dumb problems.  There are lots of time-consuming dumb problems - software libraries are usually in that category, they rarely break new ground.

Not 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.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf