OzerDrive / Mbed 2 deprecated mbed_blinky

Dependencies:   mbed Motor

main.cpp

Committer:
mksaga
Date:
2019-05-01
Revision:
7:dbe5b06987d7
Parent:
6:8562953f94bf
Child:
8:e0cd3bd2d051

File content as of revision 7:dbe5b06987d7:

#include "mbed.h"

DigitalOut motor_pin_1(p14);
DigitalOut motor_pin_2(p15);
DigitalOut motor_enable(p19);

void run_pump(int secs)
{
    motor_enable = 1;
    motor_pin_1 = 0;
    motor_pin_2 = 1;
    
    int i = 0;
    while(i < secs * 148) { i++; printf("%d | ", i);}
    motor_pin_2 = 0;
}

int main() {
    run_pump(10);
    printf("\ngreetings\n");
}