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.
Dependents: Nucleo_motors HTU21D_HELLOWORLD Major_dHome pixyMajordhome ... more
Revision 2:e575d390c730, committed 2011-05-20
- Comitter:
- jimherd
- Date:
- Fri May 20 22:28:50 2011 +0000
- Parent:
- 1:8046f460a725
- Commit message:
- Updated documentation
Changed in this revision
| MD25.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MD25.h Fri May 20 21:18:59 2011 +0000
+++ b/MD25.h Fri May 20 22:28:50 2011 +0000
@@ -130,25 +130,68 @@
/** read battery voltage
*
- * Actual voltage = (10 * value)
- *
- * @return voltage value in units of 0.1v
+ * @return voltage value in float format
*/
float getBatteryVolts(void);
/** read acceleration rate
*
* @return acceleration rate
- */
+ */
uint8_t getAccelerationRate(void);
+
+ /** read current from motor channel 1
+ *
+ * @return current value
+ */
+ uint8_t getMotor1Current(void);
- uint8_t getMotor1Current(void);
+ /** read current from motor channel 2
+ *
+ * @return current value in apprx. units of 0.1amp
+ */
uint8_t getMotor2Current(void);
+
+ /** read current speed register for motor channel 1
+ *
+ * @return speed value (0->255); meaning dependent on mode
+ */
uint8_t getMotor1Speed(void);
+
+ /** read current speed register for motor channel 2
+ *
+ * @return speed value (0->255); meaning dependent on mode
+ */
uint8_t getMotor2Speed(void);
+
+ /** read current mode
+ *
+ * @return mode value (0, 1, 2, or 3); default is mode 0
+ */
uint8_t getMode(void);
+
+ /** set system mode
+ *
+ * @param mode value (0, 1, 2, or 3)
+ */
void setMode(uint8_t mode);
+
+ /** set acceleration rate
+ *
+ * @param rate acceleration rate
+ */
void setAccelerationRate(uint8_t rate);
+
+ /** send command to command register
+ *
+ * @param command command code
+ *
+ * MD25_RESET_ENCODERS 0x20
+ * MD25_DIABLE SPEED_REGULATION 0x30
+ * MD25_ENABLE_SPEED_REGULATION 0x31
+ * MD25_DISABLE_TIMEOUT 0x32
+ * MD25_ENABLE_TIMEOUT 0x33
+ */
void setCommand(uint8_t command);
private: