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: mbed
Diff: Classes/Robot.cpp
- Revision:
- 19:dad67302af25
- Parent:
- 17:aae5361ddddf
- Child:
- 20:a1b5d032b422
--- a/Classes/Robot.cpp Tue Jun 04 17:25:49 2019 +0000
+++ b/Classes/Robot.cpp Wed Jun 05 13:25:52 2019 +0000
@@ -9,10 +9,13 @@
using namespace std;
+DigitalIn Robot::Jack(PA_15);
-Robot::Robot() : laserG(Laser(PB_1)), laserD(Laser(PC_5)), laserA(Laser(PC_4)), rouleau(Rouleau(D5, D4, D6)) /*PWM, Ejecte, Gobe*/, BPs(DigitalIn(PC_2, PullDown))
+Robot::Robot() : laserG(Laser(PB_1)), laserD(Laser(PC_5)), laserA(Laser(PC_4)), rouleau(Rouleau(D5, D4, D6)) /*PWM, Ejecte, Gobe*/,
+ BPs(DigitalIn(PC_2, PullDown))
{
can_init();
+ this->setPos(500,0,0);
}
bool Robot::aBalle()
@@ -20,6 +23,12 @@
return BPs.read();
}
+/// Fonctions Odometrie ///
+void Robot::setPos(unsigned short x, unsigned short y, signed short theta) const
+{
+ SetOdometrie(ODOMETRIE_POSITION, y, x, theta); // Oui les x et les y sont inversés...
+}
+
/// retourne l'adresse de la premiere case d'un tableau contenant dans l'ordre la position en x et en y et l'angle theta ///
short Robot::pos(int i)
{