![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Final Project files for mBed development.
control.c
- Committer:
- John Wilkey
- Date:
- 2014-11-12
- Revision:
- 5:01882c3de2dc
- Parent:
- 4:13c13a098d2b
- Child:
- 6:00b7198f0b51
File content as of revision 5:01882c3de2dc:
/** * @file control.c * @brief Motor control functions implemented from project.h * @author John Wilkey */ #include "project.h" extern pi; extern out_pins; int forward(float amt, float spd) { pi.forward(spd); wait(amt); return EXIT_SUCCESS; } int backward(float amt, float spd) { pi.backward(spd); wait(amt); return EXIT_SUCCESS; } int right(float deg) { pi.right(TURN_SPEED); wait(deg/360); return EXIT_SUCCESS; } int left(float deg) { pi.left(TURN_SPEED); wait(deg/360); return EXIT_SUCCESS; } void pretty_print(char* msg) { pi.locate(0,1); pi.printf(msg); }