librairie pour robot Zumo
Diff: zumo.h
- Revision:
- 12:d9c9ef63c5ff
- Parent:
- 11:1082c5b3b418
diff -r 1082c5b3b418 -r d9c9ef63c5ff zumo.h
--- a/zumo.h Mon Jan 10 08:59:37 2022 +0000
+++ b/zumo.h Mon Jan 10 23:00:47 2022 +0000
@@ -26,9 +26,23 @@
#include "mbed.h"
#include "platform.h"
-
+// commandes pour le ZUMO
#define SEND_MOTOR_SPEED 0xA4
#define SEND_MOTOR_STOP 0xA0
+#define SEND_ROTATE_GYRO 0x94
+#define SEND_AVANCE 0x84
+#define SEND_CALIBRE_LIGNE 0x60
+#define READ_SENSOR 0x71
+
+
+
+// sous commande de la commande READ_SENSOR
+#define DATA_SENSOR_GYRO 0x12
+#define DATA_SENSOR_MEANDIST 0x24
+#define DATA_SENSOR_LRDIST 0x38
+#define DATA_SENSOR_LIGNE 0x42
+#define DATA_SENSOR_LIGNE_5BIT 0x51
+#define DATA_SENSOR_OBSTACLE 0x62
@@ -135,11 +149,22 @@
*
*/
char speed(short spg,short spd);
-
- /** Calibrate the sensors. This turns the robot left then right, looking for a line
- *
+
+ // speed vitesse absolue
+ // rot exprim au 1/100eme de deg 45.01 sera 4501
+ char rotate_speed_gyro_wait (short spd,short rot);
+
+ // avance tout droit de dist mm
+ // avec speed positif (car calcul sens par dist)
+ // angle envoyé au centime de deg rot et sens trigo
+ char avance_wait(short spd, short dist);
+
+ /** Calibrate the sensors.
*/
- char sensor_auto_calibrate (void);
+ char Calibrate_line_sensor_wait ();
+
+ char read_data_wait (char whatdata,char*tab);
+
void PID_start(int max_speed, int a, int b, int c, int d);