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.
Revision 3:4dbbd511a49d, committed 2015-11-13
- Comitter:
- inst
- Date:
- Fri Nov 13 08:16:04 2015 +0000
- Parent:
- 2:0d9bb8e1876b
- Commit message:
Changed in this revision
| Robot.cpp | Show annotated file Show diff for this revision Revisions of this file |
| Robot.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Robot.cpp Wed Oct 14 03:50:52 2015 +0000
+++ b/Robot.cpp Fri Nov 13 08:16:04 2015 +0000
@@ -5,15 +5,15 @@
// XBee : ---- 1
// Steering {
// I2CMotor * 3, I2CServo * 3 ---- 6
-// ShootingSystem :
// I2CServo * 1 ---- 1
// }
// ShootingSystem {
// Shooter: ---- 1
// AmmoPusher: ---- 1
// AmmoSupplier: ---- 1
+// I2CServo: ---- 1
// }
-const int Robot::mNumOfI2CDevice = 12;
+const uint32_t Robot::mNumOfI2CDevices = 12;
void Robot::update(){
readI2CDevice();
@@ -22,13 +22,13 @@
}
void Robot::writeI2CDevice(){
- for ( int i = 0; i < mNumOfI2CDevice; ++i ){
+ for ( int i = 0; i < mNumOfI2CDevices; ++i ){
mI2CDevice[ i ]->writeI2C();
}
}
void Robot::readI2CDevice(){
- for ( int i = 0; i < mNumOfI2CDevice; ++i ){
+ for ( int i = 0; i < mNumOfI2CDevices; ++i ){
mI2CDevice[ i ]->readI2C();
}
}
--- a/Robot.h Wed Oct 14 03:50:52 2015 +0000
+++ b/Robot.h Fri Nov 13 08:16:04 2015 +0000
@@ -6,18 +6,20 @@
class Robot{
public:
+ static uint32_t getNumOfI2CDevices(){
+ return mNumOfI2CDevices;
+ }
void update();
- static const int mNumOfI2CDevice;
-
protected:
+ static const uint32_t mNumOfI2CDevices;
I2CDevice** mI2CDevice;
private:
virtual void updateAction() = 0;
-
void readI2CDevice();
void writeI2CDevice();
+
};
#endif