Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Robot.cpp
- Revision:
- 0:d4a8d6a32b36
diff -r 000000000000 -r d4a8d6a32b36 Robot.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Robot.cpp Wed Mar 08 16:49:14 2017 +0000 @@ -0,0 +1,29 @@ +#include "Robot.h" + +/* Work in progress -------------------------------------------- */ + +Robot::Robot(PwmOut* left, PwmOut* right, DigitalOut* enableSignal){ + this->powerSignal = enableSignal; + this->left = left; + this->right = right; + + this->left->period(0.00005f); + this->right->period(0.00005f); + } + +/* work in progress ------------------------------------------- */ +void Robot::drive(){ + //pwm determine what direction it goes. + *powerSignal = 1; + *left = 0.5; + *right = 0.5; +} + +//Remember to set +//DigitalOut powerMotor(PB_2) = 1; +//DigitalIn errorMotor(PB_14); +//if (errorMotor){ + //reset +//} + +//Add management for Overpower!! Pin PB_15