dc motor rotations are depending upon the pins given to mbed board

Dependencies:   mbed

Fork of HelloWorld by Simon Ford

DC.cpp

Committer:
KIRAN_PALTANKAR
Date:
2016-11-29
Revision:
2:d2ddd762da24

File content as of revision 2:d2ddd762da24:

#include "Dcmotor.h"
#include "mbed.h"
 
Dcmotor::Dcmotor(PinName1 pin1,PinName2 pin2) : pins(pin1,pin2) {
    pins = 0;
}
 
void Dcmotor::Dc() {
    if(pinnm==0)
    {
        pins=1;
        wait(0.2);
    }
    if(pinnm==1)
    {
        pins=2;
        wait(0.2);
    }
}