picbasic step motor kontrolü

Başlatan koordinat, 20 Ekim 2003, 14:05:09

koordinat

picbasic  ile yapılmış step motor c,kodları arıyorum.herhangi bir link çok işime yarıyacaktır.
teşekkürler

mhk

'****************************************************************
'*  Name    : Step motor kontrol                                *
'*  Author  : mhk                                               *
'*  Notice  : Copyright (c) 2002                                *
'*          : All Rights Reserved                               *
'*  Date    : 11.12.2002                                        *
'*  Version : 1.0                                               *
'*  Notes   : Step motor kontrol programı                       *
'*          :                                                   *
'****************************************************************
TRISA=%11111111
TRISB=%00000000
porta=0:portb=0
hiz var word
hiz=2500


'hiz=10000

'************************* ANA DÖNGÜ ****************************
anadongu:
portb=%00000000
   if porta.4=1 then
       if porta.3=1 then portb=0:goto anadongu
   endif    

   if porta.2=1 then
       if porta.0=1 then portb=0:goto anadongu
   endif
   

if porta.4=1 then
   if porta.2=1 then gosub stepxyileri:goto anadongu    
endif

if porta.3=1 then
   if porta.0=1 then gosub stepxygeri:goto anadongu
endif


if porta.4=1 then gosub stepxileri
if porta.3=1 then gosub stepxgeri
if porta.2=1 then gosub stepyileri
if porta.0=1 then gosub stepygeri



goto anadongu

'************************* STEP X İLERİ ****************************
stepxileri:
'6
'5
'9
'10

portb=%00000110
pauseus hiz
portb=%00000101
pauseus hiz
portb=%00001001
pauseus hiz
portb=%00001010
pauseus hiz


return

'************************* STEP X GERİ ****************************
stepxgeri:
'10
'9
'5
'6
portb=%00001010
pauseus hiz
portb=%00001001
pauseus hiz
portb=%00000101
pauseus hiz
portb=%00000110
pauseus hiz
return

'************************* STEP Y İLERİ ****************************
stepyileri:
'6
'5
'9
'10

portb=%01100000
pauseus hiz
portb=%01010000
pauseus hiz
portb=%10010000
pauseus hiz
portb=%10100000
pauseus hiz
return

'************************* STEP Y GERİ ****************************
stepygeri:
portb=%10100000
pauseus hiz
portb=%10010000
pauseus hiz
portb=%01010000
pauseus hiz
portb=%01100000
pauseus hiz

return

'*************** STEP XY İLERİ ***********************************
stepxyileri:
portb=%01100110
pauseus hiz
portb=%01010101
pauseus hiz
portb=%10011001
pauseus hiz
portb=%10101010
pauseus hiz
portb=0
return
'*************** STEP XY GERİ ***********************************
stepxygeri:
portb=%10101010
pauseus hiz
portb=%10011001
pauseus hiz
portb=%01010101
pauseus hiz
portb=%01100110
pauseus hiz
portb=0
return

end

16 F 84 ile iki adet step motor kontrol programı. İnşaallah işine yarar. Kolay gelsin
"Ya olduğun gibi görün, Ya da göründüğün gibi ol..." Mevlana

MeTaLLoRD

Dostum çok teşekkürler paylaşım için.

Benzer Konular (5)