First experiences using ChatGPT for Arduino code

Some thoughts from a very basic self confessed cut and paste Arduino code writer.

In the course of creating a recent Arduino based project a collegue suggested trying ChatGPT. A resource that I really wasn’t sure how to use.

ChatGPT is among many other things, a web based AI code writing resource. In simple terms, you tell it what you are trying to achieve, what hardware you have available and it will, very very quickly deliver code that will satisfy the requirement.

It is not perfect. ChatGPT is only as good as your ability to describe exactly what you want to happen and what the hardware being used is and what the interconnections are. In short the output result is only as good as the input data. It is still likely to be ‘not quite there’ and needs you as the client to try the code and clearly describe and feedback what is happening in the hardware so an iteration of the code can be created ….and then you go round the loop again.

It is all a bit surreal.

You are talking with a machine somewhere in the web infrastructure that you cannot help but give a human personality to. You get all the niceties of ‘Hello’, ‘Bye for now’ etc which adds to this humanisation. It becomes a partnership where the AI source does all the grunt code bashing and you become the project leader directing, testing, evaluating and feeding back.

Some might regard the process as ‘cheating’. My father always impressed on me that if a machine can do something as well or better than a human then a human should not be doing it. I believe this is the case with AI. It is a power to be harnessed to do the donkey work of writing the code while the human directs and assesses the result. The more the human can interpret the code the more successful the partnership and the more efficient the time to success of the project. My coding understanding has improved and anything that I do not understand can on request be patiently explained by my AI friend. It’s nice to be able to ask dumb questions and not be ridiculed by some forum ‘know it all’.

I can also see a looming revolution in the software industry and understand why current code writers are looking nervously over their shoulders with a great deal of discomfort and concern. My feeling is that we should grasp having a partner that can crunch all the boring dross code writing which would take a human hours to do. Instead we should step back and become project managers with intelligent direction and control of the AI source.

I have also found one aspect of a ChatGPT partnership that must be monitored and controlled – mission creep. My AI friend is constantly in need of a handbrake to stop or at least slow the avalanche of code creep that can potentially ensue. Lots of ‘it would be easy to add …’ conversations crop up which need firmly resisting until the core of the project is stable and running to plan.

All that aside I am now able to fulfill Arduino based projects to a level I never could before and with a complexity that I will never be able to fully understand. To me, ChatGPT is a very powerful partnership but with the old caveat of ‘rubbish in rubbish out’.

Links to similar or related post are listed below : –

I had a ChatGPT experience

I am currently working on a timing synchroniser for the local church clock. Being of that generation I had come up with a CMOS based phase detector with monostable timers etc. This logic looks at the relative timing of the clock strike activation and a DCF timecode reference clock. I prototyped the circuitry, proved it and made a PCB for it in Fusion. It works very well and the resulting output slows or speeds up the clock by adding or removing lead shot to the weight tray on the clock pendulum.

I got my ear bent for being so old school and not using an Arduino or similar but I was reluctant to stray from known and proven simple logic with RC time constants. In the end I caved in and out of curiosity thought it might be a good project to get my feet wet with ChatGPT.

It took a little while to find my way round the ChatGPT site and to get to the software support section. Once there I entered in simple language what I was trying to achieve. ‘It’ replied with its understanding of my needs and I agreed this was correct. I then asked for some code for an Arduino UNO.

Out popped 44 lines of Arduino code …. which worked. Oh my goodness, what a revelation. Think I need to have a cup of tea and biscuit to recover. Like Fusion and 3D printing, this is going to completely change my workflow and project practices.

Links to similar or related post are listed below : –

Verified by ExactMetrics