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: pot/pot.cpp
- Revision:
- 23:5238b046119b
- Parent:
- 22:c18f04d1dc49
--- a/pot/pot.cpp Fri Nov 18 02:47:59 2016 +0000
+++ b/pot/pot.cpp Fri Nov 18 11:55:33 2016 +0000
@@ -9,15 +9,16 @@
}
void Pot::update(){
- angular_velocity = (get_angle() - angle)/ UPDATE_TIME;
+ //angular_velocity = (get_angle() - angle)/ UPDATE_TIME;
angle=get_angle_pulse();
- velocity = (get_position() - position) / UPDATE_TIME;
- position=get_position();
+ //velocity = (get_position() - position) / UPDATE_TIME;
+ //position=get_position();
}
void Pot::set_zeros(){
this->offset = (-1)*this->get_angle();
this->encoder->reset();
+ wait(2);
}
float Pot::get_angle(){