Minimal code to spin the motor

Dependencies:   Encoder MODSERIAL mbed

Committer:
bscheltinga
Date:
Mon Sep 21 09:04:28 2015 +0000
Revision:
11:c5befe79aa53
Parent:
10:1d8b21515ed1
Get the motor spinning with the minimal amount of code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ThomasBNL 0:843492f4fe62 1 #include "mbed.h"
ThomasBNL 0:843492f4fe62 2 #include "HIDScope.h"
ThomasBNL 3:eee8d5461256 3 #include "encoder.h"
bscheltinga 11:c5befe79aa53 4 #include "MODSERIAL.h"
ThomasBNL 4:dfdfcb518e60 5
bscheltinga 11:c5befe79aa53 6 Encoder encoder1(D13,D12);
bscheltinga 11:c5befe79aa53 7 DigitalOut motor2direction(D4); //D4 en D5 zijn motor 2 (op het motorshield)
bscheltinga 11:c5befe79aa53 8 PwmOut motor2speed(D5);
ThomasBNL 6:34b39eb3dcb6 9
ThomasBNL 0:843492f4fe62 10 int main()
ThomasBNL 3:eee8d5461256 11 {
bscheltinga 11:c5befe79aa53 12 motor2direction = 1;
bscheltinga 11:c5befe79aa53 13 motor2speed = 0.2f;
ThomasBNL 3:eee8d5461256 14 }