-- Step motor sürücü programı -- **********************-- http://www.iltelis.com/-- *********************
include 16f628_4include jlib
var byte sayici
-- port atamaları başlangıcı
port_b_direction = all_output
pin_a0_direction = input
pin_a4_direction = input
pin_a5_direction = input
-- port atamalarının bitişi
Sayici = 0b_000_0001
forever loop
if pin_a4 == low then
if pin_a0 == low then
port_b = 0b_0000_1001
delay_1ms(90)
end ifif pin_a0 == low then
port_b = 0b_0000_1010
delay_1ms(90) end if
if pin_a0 == low then
port_b = 0b_0000_0110
delay_1ms(90) end if
if pin_a0 == low then
port_b = 0b_0000_0101
delay_1ms(90) end if
if pin_a0 == high then
port_b = 0b_0000_0101
delay_1ms(90) end if
if pin_a0 == high then
port_b = 0b_0000_0110
delay_1ms(90) end if
if pin_a0 == high then
port_b = 0b_0000_1010
delay_1ms(90) end if
if pin_a0 == high then
port_b = 0b_0000_1001
delay_1ms(90) end if
end if
end loop--
No comments:
Post a Comment