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: WebSocketClient mbed
Diff: routeur.hpp
- Revision:
- 4:56b1ca37a175
- Parent:
- 2:7515831bb5f5
- Child:
- 5:daf08fff7abb
--- a/routeur.hpp Mon Feb 24 15:40:33 2014 +0000
+++ b/routeur.hpp Mon Feb 24 19:30:27 2014 +0000
@@ -9,11 +9,38 @@
class Routeur
{
public:
+
+ enum Type { Accelerator, Switch };
// Constructeur
Routeur(PinName _tx, PinName _rx);
+ // Initialise accelerateur
+ void initAccel();
+
+ // Envoie les valeurs de accelerateur
+ void sendAccelValues();
+
+ // Envoie la valeur d'un capteur sec
+ void sendSwitchValue();
+
+ void setPanID(string _pan) { pan = _pan; }
+ void setType(int t) { type = static_cast<Type>(t); }
+
private:
+ int readRegister(char reg, char* data);
+ int readRegisters(char reg, int range, char* dest);
+ int writeRegister(char reg, char data);
+
Trame trame;
+
+ string pan;
+ Type type;
+
+ I2C accel;
+ DigitalIn piton;
+
+ char switchValue[1];
+ char accelValues[6];
};
#endif