Werkcollege opgave 23 september BMT K9

Dependencies:   Encoder HIDScope MODSERIAL mbed QEI biquadFilter

main.cpp

Committer:
bscheltinga
Date:
2015-09-30
Revision:
5:d60a42727a3e
Parent:
4:96e47998d495
Child:
6:ca89d5e17328
Child:
9:832b48f48a10

File content as of revision 5:d60a42727a3e:

#include "mbed.h"
#include "encoder.h"
#include "MODSERIAL.h"

//Motor 2
DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield)
PwmOut motor2speed(D5);
DigitalIn buttonL1(PTC6);
DigitalIn buttonL2(PTA4);
DigitalIn buttonH1(D2);
DigitalIn buttonH2(D6);
AnalogIn potmeter(A1);


int main()
{
   double n = (potmeter.read()/1000);
    while(true) {
        motor2direction = 1;
        motor2speed = n;
    }
}