Opzetje

Dependencies:   mbed QEI HIDScope biquadFilter MODSERIAL FastPWM

main.cpp

Committer:
boydmartherus
Date:
2019-09-20
Revision:
4:86872b89b21c
Parent:
3:ea5f67f11825
Child:
5:9f097dde857f
Child:
6:3930811edddf

File content as of revision 4:86872b89b21c:

#include "mbed.h"
#include "MODSERIAL.h";
#include "FastPWM.h" ;

Serial pc(USBTX,USBRX);

InterruptIn button1(PTC2);
InterruptIn button2(PTC3);
InterruptIn button3(PTA4);
InterruptIn button4(PTC6);

AnalogIn pot(PTB2);

FastPWM motor(D5);

int main(){ 
    printf("Controll with dial\n");    
        while(true){
            wait(0.1);
            printf("motor speed is (%f)\n\r",pot.read()); wait(0.1);
            motor.write(pot);
            }
    }