Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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;
    }
}
            
    