Werkcollege opgave 23 september BMT K9

Dependencies:   Encoder HIDScope MODSERIAL mbed QEI biquadFilter

main.cpp

Committer:
bscheltinga
Date:
2015-10-01
Revision:
9:832b48f48a10
Parent:
5:d60a42727a3e
Child:
10:2f76fa4cd2a7

File content as of revision 9:832b48f48a10:

#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()
{
    while(true) {
        double n = (potmeter.read()/250);
        motor2direction = 1;
        motor2speed = n;
    }
}