enc03r: C port; FTI; C++ wraps C

The API for this driver has changed.  See docs/apichanges.md.

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson
2017-01-27 17:58:35 -07:00
parent f914159e21
commit 1bbb9386b7
15 changed files with 758 additions and 165 deletions

View File

@ -22,7 +22,7 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//NOT TESTED!!!
public class ENC03RSample {
private static final long CALIBRATION_SAMPLES = 1000;
@ -42,14 +42,15 @@ public class ENC03RSample {
// Read the input and print both the raw value and the angular velocity,
// waiting 1 second between readings
while (true) {
long val = gyro.value();
double av = gyro.angularVelocity(val);
gyro.update();
System.out.println("Raw value: " + val + ", angular velocity: " + av + " deg/s");
System.out.println("Angular velocity: "
+ gyro.angularVelocity()
+ " deg/s");
Thread.sleep(1000);
Thread.sleep(100);
}
// ! [Interesting]
}
}
}