complete motor

Dependencies:   BufferedSerial motor_sn7544

main.cpp

Committer:
kangmingyo
Date:
2019-05-23
Revision:
1:1d18a2e8ce45
Parent:
0:dde6e4d8c301
Child:
2:a04440f0d001

File content as of revision 1:1d18a2e8ce45:

#include "mbed.h"
#include "motor.h"

MotorCtl motor1(D3,D12,D4,D5);
InterruptIn tachoINT1(D4);
InterruptIn tachoINT2(D5);
Serial pc(USBTX,USBRX,115200);

void update_current(void){
    motor1.UpdateCurrentPosition();
  //  pc.printf("Update Position\r\n");
}


int main(){
    tachoINT1.fall(&update_current);
    tachoINT1.rise(&update_current);
    tachoINT2.fall(&update_current);
    tachoINT2.rise(&update_current);
    
    while(1){
        }
    
}