ChatGPT - artificial intelligence.

UKworkshop.co.uk

Help Support UKworkshop.co.uk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
I really recomend the BBC Reith lectures 2021 in which Stuart Russell, a British computer scientist working at UC Berkeley, gives an excellent overview of AI and it’s recent and possible future impacts on our lives. Brilliantly delivered, clear and totally terrifying. Also an excellent Q&A session at the end. Should be required listening for our politicians. I listened to them whilst building some bookcases in the workshop … Think that should count as “on topic”
Indeed. I heard some of that series. I also heard an interview with Stuart Russell in which he was asked whether he thought AI would exceed human intelligence, and was struck by his answer. He basically turned the question on its head, saying do you believe the arrangement of atoms in the brain is the optimum achievable?
 
When I was at school I used to watch Tomorrows World on a Thursday with Ramond Baxter and I'm still waiting for most of the things shown to materialise 60 odd years later
I remember them demonstrating a CD disk and coating it with jam to demonstrate that was a tough and resilient recording medium. Years later, we're advised to keep them in the cases and scrupulously clean and away from sharp objects.
 
What is the difference between "feeling" and "sensing"
“Sensing refers to the process of perceiving or registering information through the senses, such as sight, hearing, touch, taste, or smell. Feeling refers to the subjective experience of emotions, such as joy, anger, sadness, or fear, that arise in response to sensory information or other stimuli. In other words, sensing is a physiological process of gathering information about the environment, while feeling is a psychological experience that arises in response to that information.”

Answer from ChatGPT
 
“Sensing refers to the process of perceiving or registering information through the senses, such as sight, hearing, touch, taste, or smell. Feeling refers to the subjective experience of emotions, such as joy, anger, sadness, or fear, that arise in response to sensory information or other stimuli. In other words, sensing is a physiological process of gathering information about the environment, while feeling is a psychological experience that arises in response to that information.”

Answer from ChatGPT
So for, say, a thermostat, the sensing is of the temperature and the feeling is the process of reacting, as programmed.
ChatGPT is programmed to retrieve information in certain ways.
 
So for, say, a thermostat, the sensing is of the temperature and the feeling is the process of reacting, as programmed.
ChatGPT is programmed to retrieve information in certain ways.
No, not unless your thermostat is happy that it has turned the boiler on. Or annoyed that it is being pestered again whilst it was trying to work something else out.
 
I needed to write a program in C++ for an automated blind opener project i'm making so i thought i would give this a try.
I asked a question with a few parameters set

write code for esp8266 to drive a stepper motor using stepper.h library and pins 2, 4, 0, 5 to two positions from 0 to 4200 steps using amazon echo and fauxmoESP. library Store the position in eeprom so if power is disconnected it remembers the last commanded position and is ready for the next command.

Within 30 secondsit spat out a full program with only two syntax errors that took a minute to fix. Saved me a few hours work. I noticed that asking the same question again produces a slightly different "tuned" answer proving it's not just churning out the same thing.
Impressed the dung out of me.

Gerry
 
I needed to write a program in C++ for an automated blind opener project i'm making so i thought i would give this a try.
I asked a question with a few parameters set

write code for esp8266 to drive a stepper motor using stepper.h library and pins 2, 4, 0, 5 to two positions from 0 to 4200 steps using amazon echo and fauxmoESP. library Store the position in eeprom so if power is disconnected it remembers the last commanded position and is ready for the next command.

Within 30 secondsit spat out a full program with only two syntax errors that took a minute to fix. Saved me a few hours work. I noticed that asking the same question again produces a slightly different "tuned" answer proving it's not just churning out the same thing.
Impressed the dung out of me.

Gerry
That's totally remarkable. Luckily I'm pretty much retired these days, as I can assure you that would have taken me more than 30 seconds!
 
Why write any program at all, most home automation systems are just plug and play ?
It generated code that Gerry could examine, and he managed to fix two syntax errors via experience. That means he understood the code and what was going on.

Many years ago, PHP (prior to Version 4.2) had something called "Register Globals" which was turned OFF by default. That meant that SQL queries could inject deletions to a database via a url.

Plug and Play does not mean the coding is good, or that something else (possibly spurious), is going on in the background that one is unaware of.
It just means it works, for the user.

Signed,
A Dinosaur 😊👍
 
Why write any program at all, most home automation systems are just plug and play ?
yes they are but usually a compromise. This a home built project to open and close roller blinds using amazon alexa. The ESP8266 microcontroller drives a stepper motor to open and close the blinds via a voice command. I have had a working system for a couple of years now i'm just on improving its function and updating the design. It costs less than a tenner a unit to make so it's financially viable and it's educational and very good fun.
 
Never used one of those processors before, started on Intels 8051 then many years on Motorolas 68000 processors with a splash of Siemens 80C166 but now microchip products and things have really changed over the years, some for the better and others for the worse.

What I dislike today is the way some programers have become nothing more than someone who puts together pre wrote blocks like building with lego, we used to have to write everything from def files to the make files to instruct the compiler how we wanted it put together and this was when the processors had Data and Address buses so everything was memory maped unlike the Microchip controllers I now use where they have so much functionality and flash memory on board, no external memory chips to remove for erasing and reprograming. This way of working forced you to understand the processor in every detail and understand exactly how it ticked. Also the cost of these new IDE's, most provide FREE systems unless you need better optimisation or looking for the last ounce of power, the likes of compilers from Introl and Greenhills were expensive and were only command line run.
 
Never used one of those processors before, started on Intels 8051 then many years on Motorolas 68000 processors with a splash of Siemens 80C166 but now microchip products and things have really changed over the years, some for the better and others for the worse.

What I dislike today is the way some programers have become nothing more than someone who puts together pre wrote blocks like building with lego, we used to have to write everything from def files to the make files to instruct the compiler how we wanted it put together and this was when the processors had Data and Address buses so everything was memory maped unlike the Microchip controllers I now use where they have so much functionality and flash memory on board, no external memory chips to remove for erasing and reprograming. This way of working forced you to understand the processor in every detail and understand exactly how it ticked. Also the cost of these new IDE's, most provide FREE systems unless you need better optimisation or looking for the last ounce of power, the likes of compilers from Introl and Greenhills were expensive and were only command line run.
The main advantage of the ESP chips is that they have built in WiFi capability. The ESP32s also have Bluetooth built in. If you have no need of WiFi or Bluetooth, then you'd probably opt for something more mainstream. I, too, started out in the days when one used to write everything from scratch, and program EPROMs. I think it's great that hobbiests can now spend their time making stuff, and don't have to fork out for expensive compilers or emulator equipment. I might be envious of the ease of access to microcontrollers, but I don't hate it.
 
Never used one of those processors before, started on Intels 8051 then many years on Motorolas 68000 processors with a splash of Siemens 80C166 but now microchip products and things have really changed over the years, some for the better and others for the worse.

What I dislike today is the way some programers have become nothing more than someone who puts together pre wrote blocks like building with lego, we used to have to write everything from def files to the make files to instruct the compiler how we wanted it put together and this was when the processors had Data and Address buses so everything was memory maped unlike the Microchip controllers I now use where they have so much functionality and flash memory on board, no external memory chips to remove for erasing and reprograming. This way of working forced you to understand the processor in every detail and understand exactly how it ticked. Also the cost of these new IDE's, most provide FREE systems unless you need better optimisation or looking for the last ounce of power, the likes of compilers from Introl and Greenhills were expensive and were only command line run.
there would be an outcry nowadays about all the punched cards and paper tape being wasted.
 
Luckily just missed that era but did have to work on mainframe terminals with little screens and green text using command line instructions, often could be like playing ping pong in slow motion !
 
I use ESP32s (and their precursor, the ESP8266) a lot, plus there's about 6 Raspberry Pis in the house doing music, radio, smart speakers and Pi-Hole.

Mostly though, I program in C++ on MSP32s for ultra-low-power IoT motes used in remote environmental monitoring. All the IDEs and compilers are free, as are the key development environment tools like git/eclipse/compilers/documentation tools etc. It's a lovely world for that sort of stuff.

Just for the hell of it, I asked ChatGPT the following question today:

write a c++ program for an MSP430 microprocessor that will read an ADC and sleep for the number of milliseconds read

This is what it replied - verbatim, unedited, in about 10 seconds:

To create a C++ program for an MSP430 microprocessor that reads an ADC and sleeps for the number of milliseconds read, you will need to use MSP430's built-in ADC and timer modules. Here's an example code that you can modify to meet your needs:
Code:
#include <msp430.h>

void initADC()
{
    ADC10CTL1 = INCH_5 + ADC10DIV_7; // Input Channel 5, ADC10CLK/8
    ADC10CTL0 = SREF_0 + ADC10SHT_3 + ADC10ON + ADC10IE; // Vcc/Vss ref, 64 clock cycles, ADC on, interrupt enabled
    ADC10AE0 |= BIT5; // Enable Analog Input A5
}

void initTimer()
{
    TA0CCTL0 = CCIE; // Capture/compare interrupt enabled
    TA0CCR0 = 0xFFFF; // Set timer period to maximum
    TA0CTL = TASSEL_2 + MC_2; // SMCLK, continuous mode
}

#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A(void)
{
    // Sleep for the ADC reading in milliseconds
    __delay_cycles(1000 * ADC10MEM * (F_CPU / 8000000)); // F_CPU is the MSP430's clock frequency
}

int main(void)
{
    WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
    initADC(); // Initialize ADC
    initTimer(); // Initialize Timer

    __bis_SR_register(GIE); // Enable global interrupts

    while (1)
    {
        ADC10CTL0 |= ENC + ADC10SC; // Start conversion
        __bis_SR_register(CPUOFF + GIE); // Enter LPM0, enable interrupts
        ADC10CTL0 &= ~ENC; // Disable conversion
    }

    return 0;
}

#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
    __bic_SR_register_on_exit(CPUOFF); // Exit LPM0
}

In this program, the initADC() function initializes the MSP430's ADC module to use input channel 5 and a clock divider of 8, with Vcc/Vss reference and 64 clock cycles. The initTimer() function initializes the MSP430's Timer module to use SMCLK (the MSP430's clock source) and continuous mode, with a period set to the maximum value. The Timer_A() interrupt service routine is triggered when the Timer module's capture/compare register matches the timer value, and it sleeps for the ADC reading in milliseconds using the __delay_cycles() function. The main function initializes the ADC and Timer modules, enables interrupts, and enters an infinite loop that starts an ADC conversion and enters low-power mode 0 (LPM0) with interrupts enabled, waiting for the ADC conversion to complete. The ADC10_ISR() interrupt service routine is triggered when the ADC conversion is complete, and it exits LPM0. You can modify the program to suit your specific requirements, such as changing the ADC input channel and clock divider, adjusting the timer period, and adding code to handle the ADC conversion results.

Frankly, I'm quite impressed. I asked it about a very specialised low power micro, and it gave fairly decent code to answer my rather obscure question.

Not only did it produce the code, it included sensible comments, used bit and register names rather than magic numbers, and an English description of the code's operation.

I also asked it a question about generating code to cross-fade digits in a nixie clock and it did that too.

(*) Before the grammar nazis come out to play, that was an Oxford Comma, that was.
 
Last edited:
its done great with excel function , i used a few times in answering forum questions and get the intermediate formulas OK but nothing difficult or a little more complex

in fact i had just asked about extracting a time from a text and it gave a more complex formula then needed - i rhen said why not 'my formula " and it relied sorry - you are right much better simplie formula

Yes, you are correct! The formula you provided =TEXTBEFORE(TEXTAFTER(B2," "),"+") is a simpler and more concise way to extract the time part "09:00:00" from the text string "01-03-2023 09:00:00 +1" in cell B2.

This formula works by using the textafter function to get the text after the space character, which gives "09:00:00 +1". Then, the textbefore function is used to get the text before the "+" character, which gives "09:00:00".

Thank you for pointing this out!
 

Latest posts

Back
Top