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.
Fork of Repo_Noeud_Mobile by
Diff: Communication/Xbee.cpp
- Revision:
- 39:558cd5780490
- Parent:
- 36:e587950c288c
- Child:
- 41:0cb286b1005e
diff -r 0196baea1d35 -r 558cd5780490 Communication/Xbee.cpp --- a/Communication/Xbee.cpp Mon Apr 06 19:52:29 2015 +0000 +++ b/Communication/Xbee.cpp Mon Apr 06 20:18:02 2015 +0000 @@ -93,6 +93,25 @@ EnvoyerDonnees(data, 8); } +void Xbee::EnvoyerStructure(Mobile_Vers_Fixe* mvf) +{ + char data[8]; + + data[0] = mvf->gants; + data[1] = mvf->accelData.x >> 8; + data[2] = mvf->accelData.x & 0x00FF; + data[3] = mvf->accelData.y >> 8; + data[4] = mvf->accelData.y & 0x00FF; + data[5] = mvf->accelData.z >> 8; + data[6] = mvf->accelData.z & 0x00FF; + + mvf->flexSensor.index == 1 ? data[7] = 0x04 : data[7] = 0; + mvf->flexSensor.majeur == 1 ? data[7] += 0x02 : data[7] += 0; + mvf->flexSensor.annulaire == 1 ? data[7] += 0x01 : data[7] += 0; + + EnvoyerDonnees(data, 8); +} + //Le noeud mobile va recevoir certaines informations comme le type de jeux et les signaux de depart/fin de parties //Structure de reception sera Fixe_Vers_Mobile void Xbee::Recevoir()