P controller to make the motor follow pot1

Dependencies:   HIDScope MODSERIAL QEI mbed

Committer:
Gerth
Date:
Wed Sep 23 10:53:36 2015 +0000
Revision:
0:3df25d5b2946
Child:
1:f367ab17bc18
start of program;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Gerth 0:3df25d5b2946 1 #include "mbed.h"
Gerth 0:3df25d5b2946 2
Gerth 0:3df25d5b2946 3 DigitalOut gpo(D0);
Gerth 0:3df25d5b2946 4 DigitalOut led(LED_RED);
Gerth 0:3df25d5b2946 5
Gerth 0:3df25d5b2946 6 int main()
Gerth 0:3df25d5b2946 7 {
Gerth 0:3df25d5b2946 8 while (true) {
Gerth 0:3df25d5b2946 9 gpo = !gpo; // toggle pin
Gerth 0:3df25d5b2946 10 led = !led; // toggle led
Gerth 0:3df25d5b2946 11 wait(0.2f);
Gerth 0:3df25d5b2946 12 }
Gerth 0:3df25d5b2946 13 }