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: Structures/Structure.h
- Revision:
- 53:7b15fe4c9edf
- Parent:
- 48:bc531288c220
- Child:
- 56:6af8f2c9ddbe
--- a/Structures/Structure.h Sat Apr 11 19:30:24 2015 +0000
+++ b/Structures/Structure.h Sat Apr 11 21:57:12 2015 +0000
@@ -1,5 +1,4 @@
#pragma once
-#define VALEURFLEX 0
typedef char GantsID;
typedef char GameID;
@@ -8,6 +7,8 @@
typedef char GameMode;
enum GameMode_e { GUNNER, RPS, AirGuitar, WAITING, TEST};
+enum AirGuitar_opMode_e {PICK, FRET};
+enum AirGuitar_note_e {DO, RE, MI, FA, SOL, LA, SI};
typedef struct {
GameID game;
@@ -29,16 +30,21 @@
SongID track_played;
} Game_Stats_AirGuitar;
-typedef struct {
+struct flex_t{
bool index;
bool majeur;
bool annulaire;
-#if VALEURFLEX
- unsigned short indexU32;
- unsigned short majeurU32;
- unsigned short annulaireU32;
-#endif
-} flex_t;
+
+ bool operator !=(const flex_t& a)
+ {
+ return( index != a.index &&
+ majeur != a.majeur &&
+ annulaire != a.annulaire
+ );
+ }
+};
+
+
typedef struct {
GameMode_e game;
@@ -46,7 +52,7 @@
typedef struct {
GantsID gants;
- Accel_t accelData; // donnée accéléromètre.
+ Accel_t accelData; // donnée accéléromètre.
flex_t flexSensor;
} Mobile_Vers_Fixe;
@@ -57,32 +63,4 @@
struct message_vers_mobile {
Fixe_Vers_Mobile donnees;
-};
-
-typedef struct flex_range_t
-{
- unsigned short min_index;
- unsigned short max_index;
- unsigned short min_majeur;
- unsigned short max_majeur;
- unsigned short min_annulaire;
- unsigned short max_annulaire;
- unsigned short limit_index;
- unsigned short limit_majeur;
- unsigned short limit_annulaire;
-
- flex_range_t() :
- min_index(0xFFFF),
- max_index(0x0000),
- min_majeur(0xFFFF),
- max_majeur(0x0000),
- min_annulaire(0xFFFF),
- max_annulaire(0x0000),
- limit_index(0x0000),
- limit_majeur(0x000),
- limit_annulaire(0x0000)
- {
- }
-} flex_range_t;
-
-
+};
\ No newline at end of file
