ChatGPT Creates Arduino Code

Sdílet
Vložit
  • čas přidán 4. 09. 2024
  • In this video, Dave uses ChapGPT 4o to create code to program an Arduino for a Digital Thermometer project. Join Dave as he walks you through this project.
    Dave also used the DALL-E AI to create the robot programming an Arduino graphic.
    Here is the prompt I used for the graphic:
    Create a photo of chatgpt writing code to program an Arduino Uno
    Here is the prompt I used to create the Arduni code:
    Please create an arduino program for an arduino uno that measures temperature and displays that temperature in degrees F on a 2 line LCD display that has a serial interface using a backpack board. The temperature probe is a dallas semiconductor probe. also, please show a wiring diagram for the project and an explanation of how it works.

Komentáře • 18

  • @jbraMoVal
    @jbraMoVal Před 3 měsíci +1

    Awesome...I tested it on version 3.5 with a simple servo motor and controlled with a potentiometer. Worked first try.
    You're right about the importance on writing the prompt. I'm excitedto try 4.0

  • @john-kneebee2143
    @john-kneebee2143 Před měsícem

    Super cool !! Nice Video !! Makes better sense to me now Thank you kind Sir

  • @HamWithCam
    @HamWithCam Před 3 měsíci

    Impressive video! Just right for those wanting to get started programming an Arduino.
    Even though I have done Arduino programming I learned something.
    Well done!

  •  Před 3 měsíci

    I've asked 3.0 to generate code for a side project I had in mind but was too lazy to read up and figure out. The pivotal method's body was only a comment saying something like; "this is left up to the reader as an exercise" I asked it then to populate that specific method, knowing the inputs and outputs required. It regenerated the whole piece of code and hid that method deeper in the code, but still same comment. I find it too eager to please and will make up stuff. I'm glad it worked for you.

    • @daveintheshop
      @daveintheshop  Před 3 měsíci

      I used the latest ChatGPT 4o on this experiment. That is "o" as in Oscar-which is supposedly much better. I have used ChatGPT 3 and found it to hallucinate frequently.

  • @scottstevens7569
    @scottstevens7569 Před 3 měsíci

    Nice information and example. Well laid out and agreeable conclusion presented. I liked the power tool anolagy.

  • @Badg0r
    @Badg0r Před 3 měsíci

    Great video! Keep up the good work with the Arduino

  • @lidimanandteam6431
    @lidimanandteam6431 Před 3 měsíci

    you deserved a lot off subscribers bro

  • @initiald975
    @initiald975 Před 2 měsíci

    Yes it can. But if it’s really super complicated, no. Like when your RTC trumps the GPS system you’re using in your project.

  • @RixtronixLAB
    @RixtronixLAB Před 3 měsíci

    Creative video,thanks :)

  • @Foozow
    @Foozow Před 3 měsíci

    I noticed that you started the video with an Arduino R4 but the finished test was using an R3, were there issues with the R4 as I was planning on getting one?

    • @daveintheshop
      @daveintheshop  Před 3 měsíci +1

      Good eye! The LCD panel actually had a problem. In switching out parts to find the issue, I substituted an R3 as part of the diagnosis steps. I tested the R4, and it works fine. Thanks for the question.

    • @Foozow
      @Foozow Před 3 měsíci

      @@daveintheshop Thanks for that. I'm very new to Arduino stuff so a lot of stuff I'm trying doesn't work at the moment haha. I'll get better though. Thanks for clarifying. 🙂

  • @daveintheshop
    @daveintheshop  Před 3 měsíci +1

    Here is the code response from ChatGPT
    Here is the code that was generated by ChatGPT:
    #include
    #include
    #include
    #include
    // Data wire is connected to pin 2
    #define ONE_WIRE_BUS 2
    // Setup a oneWire instance to communicate with any OneWire device
    OneWire oneWire(ONE_WIRE_BUS);
    // Pass oneWire reference to Dallas Temperature.
    DallasTemperature sensors(&oneWire);
    // Set the LCD address to 0x27 for a 16 chars and 2 line display
    LiquidCrystal_I2C lcd(0x27, 16, 2);
    void setup() {
    // Start the serial communication
    Serial.begin(9600);
    // Start up the library
    sensors.begin();
    // Initialize the LCD
    lcd.begin();
    lcd.backlight();
    // Print a message to the LCD
    lcd.setCursor(0, 0);
    lcd.print("Temperature:");
    }
    void loop() {
    // Request temperature from the sensor
    sensors.requestTemperatures();
    // Fetch the temperature in Celsius
    float tempC = sensors.getTempCByIndex(0);
    // Convert Celsius to Fahrenheit
    float tempF = tempC * 9.0 / 5.0 + 32.0;
    // Print the temperature in Fahrenheit on the LCD
    lcd.setCursor(0, 1);
    lcd.print(tempF);
    lcd.print(" F");
    // Wait 1 second before repeating
    delay(1000);
    }

  • @jackevans2386
    @jackevans2386 Před měsícem

    The major problem with this method is that you've learnt nothing. You might as well have bought a working temperature readout device. You will have learnt nothing there too.