DAISEN eDES see: http://mbed.org/users/okini3939/notebook/daisen-edes/

Files at this revision

API Documentation at this revision

Comitter:
okini3939
Date:
Mon Jun 17 01:46:35 2013 +0000
Parent:
1:2a38c9027bd1
Commit message:
fix;

Changed in this revision

eDES2WD.cpp Show annotated file Show diff for this revision Revisions of this file
eDES2WD.h Show annotated file Show diff for this revision Revisions of this file
--- a/eDES2WD.cpp	Sat Dec 15 15:35:30 2012 +0000
+++ b/eDES2WD.cpp	Mon Jun 17 01:46:35 2013 +0000
@@ -54,7 +54,7 @@
   _i2c.write(adrs, cmd, 4);
 }
 
-unsigned int eDES2WD::get_sensor(int id, int cn, unsigned int *dat) {
+unsigned int eDES2WD::get_sensor(int id, eDES2WD_SENSOR cn, unsigned int *dat) {
     char cmd[] = {2, I2C_RCMD_SENSOR, 0};
     char recv[MAX_CN];
     unsigned int d;
--- a/eDES2WD.h	Sat Dec 15 15:35:30 2012 +0000
+++ b/eDES2WD.h	Mon Jun 17 01:46:35 2013 +0000
@@ -50,6 +50,15 @@
     LED_RIGHT,
 };
 
+enum eDES2WD_SENSOR {
+    SENSOR_WALL_CENTER = 0,
+    SENSOR_WALL_LEFT,
+    SENSOR_WALL_RIGHT,
+    SENSOR_FLOOR_CENTER,
+    SENSOR_FLOOR_LEFT,
+    SENSOR_FLOOR_RIGHT,
+};
+
 class eDES2WD {
 public:
     eDES2WD (I2C &i2c);
@@ -57,7 +66,7 @@
     void motor (int id, int l_speed, int r_speed);
     void set_led (int id, eDES2WD_LED led, int sw);
 
-    unsigned int get_sensor(int id, int cn, unsigned int *dat);
+    unsigned int get_sensor(int id, eDES2WD_SENSOR cn, unsigned int *dat);
     int get_lat(int id, int cno);
 
 private: