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.
Dependencies: LedController mbed-rtos mbed NerfUSXbee Servomotor TargetManager
Fork of NerfUS by
mbed_source/Calibrator.cpp
- Committer:
- GaiSensei
- Date:
- 2017-04-11
- Revision:
- 46:853966aab733
- Child:
- 49:4475f0760594
File content as of revision 46:853966aab733:
#include "Calibrator.hpp" #include "mbed.h" Calibrator::Calibrator(Servomotor& servomotor): servomotor(servomotor), is_bumper_pressed(false) { } void Calibrator::calibrate() { float angle = 50; while(!is_bumper_pressed) { printf("Angle: %f\r\n", angle); servomotor.set_angle(angle); angle++; wait_ms(25); } angle -= 3; servomotor.up_angle = angle; } void Calibrator::on_rise() { is_bumper_pressed = true; }