Ardıuno step motor kontrolü yardım!!

Katılım
10 Şub 2014
Mesajlar
1
Puanları
1
Yaş
35
merhaba kolay gelsin. bir ardıuno kodum var ama kodu tamamlayamadım yardımcı olurmusunuz.
yapmak isteğim tam olarak. bir buton basıldığında motor çalışmaya başlayacak switçh geldiğinde yarım saniye duracak aksi yönde çalışmaya başlayacak eski konuma geldiğinde switch görünce duracak. taki tekrar start tuşuna basılana kadar.
kullanılan malzemeler:
ardıuno 1 adet
buton 1 adet
switch 2 adet kuru kontak nc yada no
TB6560 3.5A Step Motor Sürücü 1 adet
nema 23 step motor 1 adet
arduino-uno-tb6560-nema-23.jpg
WhatsApp Image 2020-03-13 at 21.07.02 (1).jpeg
WhatsApp Image 2020-03-13 at 21.07.02.jpeg

bir arkadaş yardımcı oldu bir kısmın ı yazdı ama tamamlayamadık.



#include <Stepper.h> //KÜTÜPHANEDEN YÜKLEDİK
int durum = 0 ;


#define buton 13
#define bswıtch 12
#define swıtchb 11

const int stepadimi = 50; // Motor dönüş acısını buradan ayarlıyoruz.




Stepper stepmotor(stepadimi, 8, 9, 10, 11);

void setup() {
pinMode(13, INPUT);
pinMode(12, INPUT);
pinMode(11, INPUT);

digitalWrite(13,LOW) ;
digitalWrite(12,LOW) ;
digitalWrite(11,LOW) ;



stepmotor.setSpeed(60);
}

void loop() {

if(digitalRead(buton)== 1 && durum == 0 )
{
durum == 1
stepmotor.step(stepadimi);


if(digitalRead(bswıtch)==0 && digitalRead(swıtchb)==1 )
{
durum == 2
delay(500);
stepmotor.step(-stepadimi);
}
if(durum == 2 && digitalRead(bswıtch)== 1)
{
/Buraya motoru durduracak kodu yazmanız gerekiyor.
durum = 0
 

Forum istatistikleri

Konular
128,126
Mesajlar
915,250
Kullanıcılar
449,840
Son üye
111340

Yeni konular

Geri
Üst