Phlebot's onboard code

Dependencies:   mbed

Fork of HelloWorld by Simon Ford

main.cpp

Committer:
gardamerinos
Date:
2017-02-21
Revision:
2:0c6fdc8ec9a9
Parent:
0:fb6bbc10ffa0
Child:
3:ce96e87c0c53

File content as of revision 2:0c6fdc8ec9a9:

#include "mbed.h"

DigitalOut stepperX_DIR(p26);
PwmOut stepperX_PWM(p21);

int main() {
    stepperX_PWM.period(0.001f);      // 4 second period
    stepperX_PWM.write(0.50f);      // 50% duty cycle, relative to period
    while(1) {
        stepperX_DIR = 1;
        wait(1);
        stepperX_DIR = 0;
        wait(1);
    }
}