Arduino için hangi yazılım dili öğrenilmeli?

TecnoHesap

Picopat
Katılım
1 Temmuz 2023
Mesajlar
133
Daha fazla  
Cinsiyet
Erkek
Yeni başlayacağım heves için alacağım 600 TL bütçem var ne alabilirim?


Ben bunları düşünüyorum sizce?

Kusura bakmayın konuyla alakasız ama ben de başlamak istiyorum. Hangi yazılım dilini öğrenmem gerek ve eğitim olarak YouTube veya Udemy üzerinden tavsiyeniz var mıdır?
 
Son düzenleyen: Moderatör:
Hocam arada fark yok aslında. Sadece kütüphaneler ile olay çok daha basite indirgeniyor. Örneğin bu stm32 için yazılmış bir step motor kodu aynısını arduino için aşağıya bırakıyorum
C:
#include "stm32f10x.h"

#define STEP_PIN    GPIO_Pin_0
#define DIRECTION_PIN GPIO_Pin_1
#define ENABLE_PIN   GPIO_Pin_2

void Delay(__IO uint32_t nCount) {
    while(nCount--) {
    }
}

void GPIO_Configuration(void) {
    GPIO_InitTypeDef GPIO_InitStructure;
    
    // Enable the GPIO Clock for Port A
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);

    // Configure STEP_PIN, DIRECTION_PIN, and ENABLE_PIN as output
    GPIO_InitStructure.GPIO_Pin = STEP_PIN | DIRECTION_PIN | ENABLE_PIN;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOA, &GPIO_InitStructure);
}

int main(void) {
    GPIO_Configuration();
    
    while(1) {
        // Set the direction (0 or 1) using DIRECTION_PIN
        GPIO_SetBits(GPIOA, DIRECTION_PIN);
        
        // Enable the motor using ENABLE_PIN
        GPIO_ResetBits(GPIOA, ENABLE_PIN);
        
        // Generate a series of pulses to STEP_PIN to make the motor move
        for (int i = 0; i < 200; i++) {
            GPIO_SetBits(GPIOA, STEP_PIN);
            Delay(10000); // Adjust this delay to control motor speed
            GPIO_ResetBits(GPIOA, STEP_PIN);
            Delay(10000); // Adjust this delay to control motor speed
        }
        
        // Disable the motor using ENABLE_PIN
        GPIO_SetBits(GPIOA, ENABLE_PIN);
        
        // Reverse direction
        GPIO_ResetBits(GPIOA, DIRECTION_PIN);
        
        // Enable the motor using ENABLE_PIN
        GPIO_ResetBits(GPIOA, ENABLE_PIN);
        
        // Generate a series of pulses to STEP_PIN to make the motor move in the reverse direction
        for (int i = 0; i < 200; i++) {
            GPIO_SetBits(GPIOA, STEP_PIN);
            Delay(10000); // Adjust this delay to control motor speed
            GPIO_ResetBits(GPIOA, STEP_PIN);
            Delay(10000); // Adjust this delay to control motor speed
        }
        
        // Disable the motor using ENABLE_PIN
        GPIO_SetBits(GPIOA, ENABLE_PIN);
    }
}

Kod:
#include <AFMotor.h>

AF_Stepper motor(200, 1); // 200 adım, motor 1

void setup() {
  motor.setSpeed(100); // Motor hızı ayarı (düşük veya yüksek hız değeri kullanabilirsiniz)
}

void loop() {
  // Saat yönünde döndür
  motor.step(200, FORWARD); // 200 adım ileri
  delay(1000); // 1 saniye bekle

  // Ters yönde döndür
  motor.step(200, BACKWARD); // 200 adım geri
  delay(1000); // 1 saniye bekle
}
 

Technopat Haberler

Geri
Yukarı