Znaleziono 2 wyniki

autor: everr
21 gru 2010, 22:46
Forum: Elektronika CNC
Temat: Sterowanie dwóch silników przez ATMega8
Odpowiedzi: 24
Odsłony: 6233

Petla raczej konieczna :D Można to zrealizować na kilka innych sposobów ale jak dla osoby nie wtajemniczonej to raczej dobre rozwiązanie. Jak usiądzie nad programem po kilku tygodniach od uruchomienia wtedy zacznie optymalizować program...ale najpierw może niech uruchomi cokolwiek :D
autor: everr
21 gru 2010, 15:41
Forum: Elektronika CNC
Temat: Sterowanie dwóch silników przez ATMega8
Odpowiedzi: 24
Odsłony: 6233

Skoro jesteś "zielony" w tej tematyce to radzę zacząć programować w bascomie. Poniżej podaje sekwencję pracy pół-krokowej w jedną stronę dla jednego silnika i jest to chyba 16 takich półkroków. w drugą stronę wystarczy zmienić kolejność. Dodasz do tego jakieś pętle i będzie działać jak chcesz ;)

Kod: Zaznacz cały

 Set Portd.4 : Reset Portd.5 : Reset Portd.6 : Set Portd.7
 Waitms 5

 Reset Portd.4 : Reset Portd.5 : Reset Portd.6 : Set Portd.7
 Waitms 5

 Reset Portd.4 : Set Portd.5 : Reset Portd.6 : Set Portd.7
 Waitms 5

 Reset Portd.4 : Set Portd.5 : Reset Portd.6 : Reset Portd.7
 Waitms 5

 Reset Portd.4 : Set Portd.5 : Set Portd.6 : Reset Portd.7
 Waitms 5

 Reset Portd.4 : Reset Portd.5 : Set Portd.6 : Reset Portd.7
 Waitms 5

 Set Portd.4 : Reset Portd.5 : Set Portd.6 : Reset Portd.7
 Waitms 5

 Set Portd.4 : Reset Portd.5 : Reset Portd.6 : Reset Portd.7
 Waitms 5

 Set Portd.4 : Reset Portd.5 : Reset Portd.6 : Set Portd.7
 Waitms 5

 Reset Portd.4 : Reset Portd.5 : Reset Portd.6 : Set Portd.7
 Waitms 5

 Reset Portd.4 : Set Portd.5 : Reset Portd.6 : Set Portd.7
 Waitms 5

 Reset Portd.4 : Set Portd.5 : Reset Portd.6 : Reset Portd.7
 Waitms 5

 Reset Portd.4 : Set Portd.5 : Set Portd.6 : Reset Portd.7
 Waitms 5

 Reset Portd.4 : Reset Portd.5 : Set Portd.6 : Reset Portd.7
 Waitms 5

 Set Portd.4 : Reset Portd.5 : Set Portd.6 : Reset Portd.7
 Waitms 5

 Set Portd.4 : Reset Portd.5 : Reset Portd.6 : Reset Portd.7
Czasy oczywiście mogą być mniejsze a nawet i powinny być rzędu us.

Wróć do „Sterowanie dwóch silników przez ATMega8”