Werkcollege opgave 23 september BMT K9

Dependencies:   Encoder HIDScope MODSERIAL mbed QEI biquadFilter

Committer:
bscheltinga
Date:
Wed Sep 23 08:57:01 2015 +0000
Revision:
1:0a89274e1279
Parent:
0:fe3896c6eeb0
Child:
2:e6c1bdc5639e
Child:
3:2785a945b654
Child:
7:f01efd933bfd
Motor 1s CCW en 1s CW

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bscheltinga 0:fe3896c6eeb0 1 #include "mbed.h"
bscheltinga 0:fe3896c6eeb0 2 #include "HIDScope.h"
bscheltinga 0:fe3896c6eeb0 3 #include "encoder.h"
bscheltinga 0:fe3896c6eeb0 4 #include "MODSERIAL.h"
bscheltinga 0:fe3896c6eeb0 5
bscheltinga 0:fe3896c6eeb0 6 //Motor 2
bscheltinga 0:fe3896c6eeb0 7 DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield)
bscheltinga 0:fe3896c6eeb0 8 PwmOut motor2speed(D5);
bscheltinga 0:fe3896c6eeb0 9 DigitalIn button(PTA4);
bscheltinga 0:fe3896c6eeb0 10
bscheltinga 0:fe3896c6eeb0 11 int main()
bscheltinga 0:fe3896c6eeb0 12 {
bscheltinga 0:fe3896c6eeb0 13 while(true) {
bscheltinga 1:0a89274e1279 14 motor2direction = 1;
bscheltinga 1:0a89274e1279 15 motor2speed = 0.5f;
bscheltinga 1:0a89274e1279 16 wait (1);
bscheltinga 1:0a89274e1279 17 motor2direction = 0;
bscheltinga 1:0a89274e1279 18 wait (1);
bscheltinga 0:fe3896c6eeb0 19 }
bscheltinga 0:fe3896c6eeb0 20 }