Samenwerking Groep 12
Dependencies: Encoder MODSERIAL HIDScope mbed
Foo
Diff: main.cpp
- Revision:
- 0:86df750eeab8
- Child:
- 1:73c4c9192d80
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Sep 21 09:54:59 2015 +0000 @@ -0,0 +1,25 @@ +#include "mbed.h" +#include "HIDScope.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 button(PTA4); + +int main() +{ + while(true) { + if (button.read() == 0) { + motor2direction = 1; + motor2speed = 0.5f; + } else { + motor2direction = 0; + motor2speed = 0.3f; + } + } +} + +// Geen functie hieronder nog +Encoder encoder1(D13,D12); \ No newline at end of file