pieter Berteloot
/
Project2
k
Fork of m3pi_HelloWorld by
Controller.cpp@8:a6afbbc052e2, 2017-04-19 (annotated)
- Committer:
- pietor
- Date:
- Wed Apr 19 09:51:15 2017 +0000
- Revision:
- 8:a6afbbc052e2
k
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pietor | 8:a6afbbc052e2 | 1 | /** |
pietor | 8:a6afbbc052e2 | 2 | Controller.cpp |
pietor | 8:a6afbbc052e2 | 3 | Purpose: |
pietor | 8:a6afbbc052e2 | 4 | |
pietor | 8:a6afbbc052e2 | 5 | @author Pieter Berteloot |
pietor | 8:a6afbbc052e2 | 6 | */ |
pietor | 8:a6afbbc052e2 | 7 | |
pietor | 8:a6afbbc052e2 | 8 | #include "mbed.h" |
pietor | 8:a6afbbc052e2 | 9 | #include "Controller.h" |
pietor | 8:a6afbbc052e2 | 10 | #include "m3pi.h" |
pietor | 8:a6afbbc052e2 | 11 | |
pietor | 8:a6afbbc052e2 | 12 | m3pi m3pi; |
pietor | 8:a6afbbc052e2 | 13 | |
pietor | 8:a6afbbc052e2 | 14 | //constructor |
pietor | 8:a6afbbc052e2 | 15 | Controller::Controller() { |
pietor | 8:a6afbbc052e2 | 16 | |
pietor | 8:a6afbbc052e2 | 17 | m3pi.locate(0,1); |
pietor | 8:a6afbbc052e2 | 18 | }; |
pietor | 8:a6afbbc052e2 | 19 | |
pietor | 8:a6afbbc052e2 | 20 | |
pietor | 8:a6afbbc052e2 | 21 | void Controller::leftMotor(float speedLeft) |
pietor | 8:a6afbbc052e2 | 22 | { |
pietor | 8:a6afbbc052e2 | 23 | |
pietor | 8:a6afbbc052e2 | 24 | m3pi.left_motor(speedLeft); |
pietor | 8:a6afbbc052e2 | 25 | |
pietor | 8:a6afbbc052e2 | 26 | } |
pietor | 8:a6afbbc052e2 | 27 | |
pietor | 8:a6afbbc052e2 | 28 | void Controller::rightMotor(float speedRight) |
pietor | 8:a6afbbc052e2 | 29 | { |
pietor | 8:a6afbbc052e2 | 30 | |
pietor | 8:a6afbbc052e2 | 31 | m3pi.right_motor(speedRight); |
pietor | 8:a6afbbc052e2 | 32 | |
pietor | 8:a6afbbc052e2 | 33 | } |
pietor | 8:a6afbbc052e2 | 34 |