Chat GPT deneme.

Ahmet

S38>S85
Katılım
31 Mayıs 2021
Mesajlar
6,052
CHATGPT0.png


Analog ortlama alacağın bir program yaz dedim.
C++:
const int numSamples = 10;  // Number of samples to average
int samples[numSamples];    // Array to hold the samples
int sum = 0;                // Sum of the samples
int average = 0;            // Average of the samples

void loop() {
  // Read the input from the sensor
  int input = analogRead(A0);

  // Add the new sample to the sum and remove the oldest sample
  sum = sum - samples[0] + input;
  // Shift the samples in the array
  for (int i = 0; i < numSamples - 1; i++) {
    samples[i] = samples[i + 1];
  }
  // Add the new sample to the end of the array
  samples[numSamples - 1] = input;

  // Calculate the average
  average = sum / numSamples;

  // Use the average value for further processing or display
  ...
}

7 segment sürücü yaz dedim
C++:
const int dataPin = 8;
const int latchPin = 12;
const int clockPin = 11;
const int digitPins[8] = {2, 3, 4, 5, 6, 7, 8, 9};

void setup() {
  // Set the pin modes for the shift register and the display
  pinMode(dataPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  for (int i = 0; i < 8; i++) {
    pinMode(digitPins[i], OUTPUT);
  }
}

void loop() {
  // Send the data to the shift register
  shiftOut(dataPin, clockPin, MSBFIRST, 0b11111100);
  // Latch the data to the display
  digitalWrite(latchPin, HIGH);
  digitalWrite(latchPin, LOW);
  // Turn on the first digit
  digitalWrite(digitPins[0], HIGH);
  // Wait for a specified time
  delay(1);
  // Turn off the first digit
  digitalWrite(digitPins[0], LOW);
  // Repeat for the other digits
}

OLED EKRAN KULLAN DEDİM
C++:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// Define the OLED display and the pins for the parallel interface
Adafruit_SSD1306 display(128, 64, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

void setup() {
  // Initialize the OLED display
  display.begin(SSD1306_SWITCHCAPVCC);
  // Clear the display
  display.clearDisplay();
  // Set the text size and color
  display.setTextSize(1);
  display.setTextColor(WHITE);
}

void loop() {
  // Draw a line on the display
  display.drawLine(0, 0, 127, 63, WHITE);
  // Draw some text on the display
  display.setCursor(0, 0);
  display.println("Hello, World!");
  // Update the display
  display.display();
  // Wait for a specified time
  delay(1000);
}

Eğer alogirtmayı kilitleyeceğini düşündüğünüz sorular varsa söyleyin soralım,
@taydin ve @ozkarah ne soralım da kilitlensin bu chatGPT.
 
STM32F401 İÇİN BLINK YAZ DEDIM
C++:
#include "stm32f4xx.h"

// Define the LED pin
#define LED_PIN GPIO_PIN_5
#define LED_PORT GPIOC

int main(void)
{
  // Enable the clock for the LED port
  RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN;

  // Set the LED pin as an output
  LED_PORT->MODER &= ~(GPIO_MODER_MODER5_0 | GPIO_MODER_MODER5_1);
  LED_PORT->MODER |= GPIO_MODER_MODER5_0;

  // Set the LED pin to high speed
  LED_PORT->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR5;

  // Set the LED pin to push-pull output
  LED_PORT->OTYPER &= ~GPIO_OTYPER_OT_5;

  while (1)
  {
    // Turn the LED on
    LED_PORT->BSRRL = LED_PIN;
    // Wait for a specified time
    for (int i = 0; i < 1000000; i++);
    // Turn the LED off
    LED_PORT->BSRRH = LED_PIN;
    // Wait for a specified time
    for (int i = 0; i < 1000000; i++);
  }
}
 
STM32F401 İÇİN BLINK YAZ DEDIM
C++:
#include "stm32f4xx.h"

// Define the LED pin
#define LED_PIN GPIO_PIN_5
#define LED_PORT GPIOC

int main(void)
{
  // Enable the clock for the LED port
  RCC->AHB1ENR |= RCC_AHB1ENR_GPIOCEN;

  // Set the LED pin as an output
  LED_PORT->MODER &= ~(GPIO_MODER_MODER5_0 | GPIO_MODER_MODER5_1);
  LED_PORT->MODER |= GPIO_MODER_MODER5_0;

  // Set the LED pin to high speed
  LED_PORT->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR5;

  // Set the LED pin to push-pull output
  LED_PORT->OTYPER &= ~GPIO_OTYPER_OT_5;

  while (1)
  {
    // Turn the LED on
    LED_PORT->BSRRL = LED_PIN;
    // Wait for a specified time
    for (int i = 0; i < 1000000; i++);
    // Turn the LED off
    LED_PORT->BSRRH = LED_PIN;
    // Wait for a specified time
    for (int i = 0; i < 1000000; i++);
  }
}
4 basamaklı 3 tane yedi segment display'de 4 basamaklı 3 ayrı sayı yazdırsın dahili spi kullansın.
E-yükün öinimum sistem display sürücüsü hallolmuş olur.
 
4 basamaklı 3 tane yedi segment display'de 4 basamaklı 3 ayrı sayı yazdırsın dahili spi kullansın.
E-yükün öinimum sistem display sürücüsü hallolmuş olur.
abi ben 128x64 GLCD beyaz üstüne siyah düşünüyordum displayi görüntü çok güzel oluyor.

bir soralım bakalım yapabilecek mi.
 
Grafik daha güzel olur. Temel kontrolleri hallettik mi display zaten incik boncuk.
C++:
#include <stdint.h>
#include <stm32f401xx.h>

// Constants for the 74HC595 shift registers
#define DATA_PIN GPIO_PIN_5
#define CLOCK_PIN GPIO_PIN_6
#define LATCH_PIN GPIO_PIN_7

// Function prototypes
void sendData(uint8_t data, uint8_t displayNumber);

int main(void) {
  // Set up the STM32F401 and the 74HC595 shift registers
  // (omitted for brevity)

  // Send some data to the displays
  sendData(0x3F, 1); // Display "0" on the first display
  sendData(0x06, 2); // Display "1" on the second display
  sendData(0x5B, 3); // Display "2" on the third display

  while(1) {
    // Do other things here
  }
}

void sendData(uint8_t data, uint8_t displayNumber) {
  // Set the latch pin low to begin sending data
  HAL_GPIO_WritePin(GPIOD, LATCH_PIN, GPIO_PIN_RESET);

  // Send the display number (0-2) to the first 3 shift registers
  for (int i = 0; i < 3; i++) {
    if (i == displayNumber) {
      // Set the data pin high if this is the correct display
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_SET);
    } else {
      // Set the data pin low for the other displays
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_RESET);
    }
    // Pulse the clock pin to send the data
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_SET);
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_RESET);
  }

  // Send the data for the selected display to the next 4 shift registers
  for (int i = 0; i < 4; i++) {
    if ((data >> i) & 1) {
      // Set the data pin high if this bit is set
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_SET);
    } else {
      // Set the data pin low if this bit is not set
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_RESET);
    }
    // Pulse the clock pin to send the data
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_SET);
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_RESET);
  }

  // Set the latch pin high to update the outputs
  HAL_GPIO_WritePin(GPIOD, LATCH_PIN, GPIO_PIN_SET);
}
Biraz kendi kafasına göre çalışıyor.
canı isterse register ile yazıyor canı isterse spl ile yazıyor canı isterse hal ile yazıyor.

verdiğim emir;
Generate c code that will drive 3 separate 4 digit 7 segment displays

aldığımız çıktı yukarıda.
 
C++:
#include <stdint.h>
#include <stm32f401xx.h>

// Constants for the 74HC595 shift registers
#define DATA_PIN GPIO_PIN_5
#define CLOCK_PIN GPIO_PIN_6
#define LATCH_PIN GPIO_PIN_7

// Function prototypes
void sendData(uint8_t data, uint8_t displayNumber);

int main(void) {
  // Set up the STM32F401 and the 74HC595 shift registers
  // (omitted for brevity)

  // Send some data to the displays
  sendData(0x3F, 1); // Display "0" on the first display
  sendData(0x06, 2); // Display "1" on the second display
  sendData(0x5B, 3); // Display "2" on the third display

  while(1) {
    // Do other things here
  }
}

void sendData(uint8_t data, uint8_t displayNumber) {
  // Set the latch pin low to begin sending data
  HAL_GPIO_WritePin(GPIOD, LATCH_PIN, GPIO_PIN_RESET);

  // Send the display number (0-2) to the first 3 shift registers
  for (int i = 0; i < 3; i++) {
    if (i == displayNumber) {
      // Set the data pin high if this is the correct display
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_SET);
    } else {
      // Set the data pin low for the other displays
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_RESET);
    }
    // Pulse the clock pin to send the data
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_SET);
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_RESET);
  }

  // Send the data for the selected display to the next 4 shift registers
  for (int i = 0; i < 4; i++) {
    if ((data >> i) & 1) {
      // Set the data pin high if this bit is set
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_SET);
    } else {
      // Set the data pin low if this bit is not set
      HAL_GPIO_WritePin(GPIOD, DATA_PIN, GPIO_PIN_RESET);
    }
    // Pulse the clock pin to send the data
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_SET);
    HAL_GPIO_WritePin(GPIOD, CLOCK_PIN, GPIO_PIN_RESET);
  }

  // Set the latch pin high to update the outputs
  HAL_GPIO_WritePin(GPIOD, LATCH_PIN, GPIO_PIN_SET);
}
Biraz kendi kafasına göre çalışıyor.
canı isterse register ile yazıyor canı isterse spl ile yazıyor canı isterse hal ile yazıyor.

verdiğim emir;
Generate c code that will drive 3 separate 4 digit 7 segment displays

aldığımız çıktı yukarıda.
Sanki biz biraz daha spesifik olursak daha işe yarar çıktı üretecek kadar kabiliyetli gibi. Display'leri basamak başına bir shift register olarak kullanmak ya da multipleks yoluyla kullanmak arasındaki farkı da bilir belki. Herkes oynayabiliyor mu bununla yoksa davet gibi bir uygulama mı var.
 
Sanki biz biraz daha spesifik olursak daha işe yarar çıktı üretecek kadar kabiliyetli gibi. Display'leri basamak başına bir shift register olarak kullanmak ya da multipleks yoluyla kullanmak arasındaki farkı da bilir belki. Herkes oynayabiliyor mu bununla yoksa davet gibi bir uygulama mı var.
oynayabilirsin abi sadece ingilizce yazmak yeterli o anlıyor senin ne istediğini.

google hesabı ile giriş yapıalbiliyor.
 
bana bu biraz verdiğin anahtar kelimeler ile google araştırması yapıyor en topic olanı sana sunuyor gibi geldi.
mesela az önce bir neo6m kodu üretmesini istedim gidip github tinygps basic example programını yazdı bana bire bir aynısını.
 
Ortalama alma kodu optimum değil. Bir kere array'i doldurduktan sonran tek toplama ve tek çıkarma yeterli. Bana göre yapay zeka insan zekasına göre her zaman çok ilkel kalacaktır.
 
Ahmet sen bu ara çok ChatGPT kullanıyorsun. Hayırdır? :katil2:

Screenshot_20221230-223427.jpg
 
21407 eklentisine bak

Analog ortlama alacağın bir program yaz dedim.
C++:
const int numSamples = 10;  // Number of samples to average
int samples[numSamples];    // Array to hold the samples
int sum = 0;                // Sum of the samples
int average = 0;            // Average of the samples

void loop() {
  // Read the input from the sensor
  int input = analogRead(A0);

  // Add the new sample to the sum and remove the oldest sample
  sum = sum - samples[0] + input;
  // Shift the samples in the array
  for (int i = 0; i < numSamples - 1; i++) {
    samples[i] = samples[i + 1];
  }
  // Add the new sample to the end of the array
  samples[numSamples - 1] = input;

  // Calculate the average
  average = sum / numSamples;

  // Use the average value for further processing or display
  ...
}

7 segment sürücü yaz dedim
C++:
const int dataPin = 8;
const int latchPin = 12;
const int clockPin = 11;
const int digitPins[8] = {2, 3, 4, 5, 6, 7, 8, 9};

void setup() {
  // Set the pin modes for the shift register and the display
  pinMode(dataPin, OUTPUT);
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  for (int i = 0; i < 8; i++) {
    pinMode(digitPins[i], OUTPUT);
  }
}

void loop() {
  // Send the data to the shift register
  shiftOut(dataPin, clockPin, MSBFIRST, 0b11111100);
  // Latch the data to the display
  digitalWrite(latchPin, HIGH);
  digitalWrite(latchPin, LOW);
  // Turn on the first digit
  digitalWrite(digitPins[0], HIGH);
  // Wait for a specified time
  delay(1);
  // Turn off the first digit
  digitalWrite(digitPins[0], LOW);
  // Repeat for the other digits
}

OLED EKRAN KULLAN DEDİM
C++:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// Define the OLED display and the pins for the parallel interface
Adafruit_SSD1306 display(128, 64, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

void setup() {
  // Initialize the OLED display
  display.begin(SSD1306_SWITCHCAPVCC);
  // Clear the display
  display.clearDisplay();
  // Set the text size and color
  display.setTextSize(1);
  display.setTextColor(WHITE);
}

void loop() {
  // Draw a line on the display
  display.drawLine(0, 0, 127, 63, WHITE);
  // Draw some text on the display
  display.setCursor(0, 0);
  display.println("Hello, World!");
  // Update the display
  display.display();
  // Wait for a specified time
  delay(1000);
}

Eğer alogirtmayı kilitleyeceğini düşündüğünüz sorular varsa söyleyin soralım,
@taydin ve @ozkarah ne soralım da kilitlensin bu chatGPT.
ChatGPT'nin işini yapan program nasıl yazılır de bakalım :p
 
bu chat gpt program yazmıyormuş, verdiğin cümleyi aratıp en eşleşeni sana sunuyor.
ben bunu github co pilot gibi birşey sandım başta.
 
Bu ChatGPT yeni çıkan bir şey mi? Bir kaç gündür sürekli karşıma çıkıyor sağda solda.

 
Ben daha ne olduğunu anlamadım. Konuyu açan bizim gibi morukları hiç düşünmüyor. :D
estağfurullah abi ne moruğu ://

chatGPT sözde programcıların ayağını kaydırmak için piyasaya çıkmış gibi görülen, ama tamamen hurafe olan senin verdiğin anahatar kelimeleri hızlıca google'de arayıp en eşleşeni sunan bir yapı.

asıl programcıların ayağını kaydırabilecek yapı Github CoPilot oda bildiğim kadarıyla C dillerini yazamıyor.
 
Şimdi bir gerilim bölücü istedim ChatGPT efendiden, saçma sapan birşeyler zırvaladı. Demekki kısa vadede ödevcilerden kurtulamayacağız daha :katil2:

1672937097342.png
 
İtiraz edince hatasını düzeltti :oops:

1672937388483.png
 
Spesifik değerlere göre sonuç isteyince de yapıyor. Cümle analizi işini çözmüş herifler.

1672937637906.png
 

Forum istatistikleri

Konular
5,789
Mesajlar
99,024
Üyeler
2,464
Son üye
s4met

Son kaynaklar

Son profil mesajları

cemalettin keçeci wrote on HaydarBaris's profile.
barış kardeşim bende bu sene akıllı denizaltı projesine girdim ve sensörleri arastırıyorum tam olarak hangi sensör ve markaları kullandınız yardımcı olabilir misin?
m.white wrote on Altair's profile.
İyi akşamlar.Arabanız ne marka ve sorunu nedir.Ben araba tamircisi değilim ama tamirden anlarım.
* En mühim ve feyizli vazifelerimiz millî eğitim işleridir. Millî eğitim işlerinde mutlaka muzaffer olmak lâzımdır. Bir milletin hakikî kurtuluşu ancak bu suretle olur. (1922)
Kesici/Spindle hızı hesaplamak için SpreadSheet UDF'leri kullanın, hesap makinesi çok eski kalan bir yöntem :)
Dr. Bülent Başaran,
Elektrik ve Elektronik Mühendisi
Yonga Tasarım Özdevinimcisi
Üç güzel "çocuk" babası
Ortahisar/Ürgüp/Konya/Ankara/Pittsburgh/San Francisco/Atlanta/Alaçatı/Taşucu...

Back
Top