Program for driving unipolar stepper motor model RoHS 28BYJ-48 12 VDC. Motor can be driven in wave, full step, and half step modes in clockwise and anticlockwise directions.

Dependencies:   mbed

main.cpp

Committer:
emilmont
Date:
2012-10-24
Revision:
2:f37d74a0e3e2
Parent:
1:4f62fc36c30d
Child:
5:f81d343c3d7a

File content as of revision 2:f37d74a0e3e2:

#include "mbed.h"

int main() {
    DigitalOut gpo(PTB8);
    DigitalOut led(LED_RED);

    while (true) {
        gpo = 1;
        led = 1; // Off
        wait(2);
        gpo = 0;
        led = 0; // on
        wait(2);
    }
}