Control up to two motors using filtered EMG signals and a PID controller

Dependencies:   FastPWM HIDScope MODSERIAL QEI Matrix biquadFilter controller errorFetch mbed motorConfig refGen MatrixMath inverseKinematics

Fork of Minor_test_serial by First Last

main.cpp

Committer:
tvlogman
Date:
2017-09-21
Revision:
11:d1692be2de30
Parent:
10:e23cbcdde7e3
Child:
12:0462757e1ed2

File content as of revision 11:d1692be2de30:

#include "mbed.h"
#include "MODSERIAL.h"
#include "HIDScope.h"
#include "QEI.h"

QEI Encoder(D12,D13,NC,32);
MODSERIAL pc(USBTX, USBRX);

Ticker encoderTicker;
volatile int counts = 0;


void readEncoder(){
    counts = Encoder.getPulses();
    pc.printf("%i pulses", counts);
    }


int main()
    {
    pc.baud(115200);
    encoderTicker.attach(readEncoder, 0.5);    
    pc.printf("Encoder ticker attached and baudrate set");

    }