Skematik Autoroof menggunakan minsys mcs-51 dengan aplikasi proteus
link download : https://drive.google.com/file/d/0B1UiWGEo4NYJQW16blVpQVowSms/view?usp=sharing
| 01 | // Akses Motor Stepper | 
| 02 | // By Fickry Muhammad | 
| 03 | // aruselektronika.blogspot.com | 
| 04 | intsmDirectionPin = 2; //Direction pin | 
| 05 | intsmStepPin = 3; //Stepper pin | 
| 06 |   | 
| 07 | voidsetup() | 
| 08 | { | 
| 09 |   pinMode(smStepPin, OUTPUT); | 
| 10 | } | 
| 11 |   | 
| 12 | voidloop(){ | 
| 13 |   for(inti = 0; i < 3000; i++) | 
| 14 |   { | 
| 15 |     digitalWrite(smDirectionPin, LOW); | 
| 16 |     digitalWrite(smStepPin, HIGH); | 
| 17 |     delayMicroseconds(300); | 
| 18 |     digitalWrite(smStepPin, LOW); | 
| 19 |     delayMicroseconds(300); | 
| 20 |   } | 
| 21 | 
| 22 |   delay(300);  | 
| 23 |   | 
| 24 |   for(inti = 3000; i > 0; i--) | 
| 25 |   { | 
| 26 |     pinMode(smDirectionPin, OUTPUT); | 
| 27 |     digitalWrite(smDirectionPin, HIGH); | 
| 28 |     digitalWrite(smStepPin, LOW); | 
| 29 |     delayMicroseconds(300); | 
| 30 |     digitalWrite(smStepPin, HIGH); | 
| 31 |     delayMicroseconds(300); | 
| 32 |   } | 
| 33 |   delay(300); | 
| 34 | } |