Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
wiki:projets:dadgad_miseenoeuvre [2016/04/20 15:54] benjamin [Bluetooth et test] |
wiki:projets:dadgad_miseenoeuvre [2016/09/11 10:59] (Version actuelle) |
||
---|---|---|---|
Ligne 11: | Ligne 11: | ||
\\ | \\ | ||
- | \\ | ||
- | ===== Améliorations ===== | ||
- | Pour piloter notre accordeur et pour pouvoir proposer différent type d' | ||
- | * L' | ||
- | * Alourdit le code de l' | ||
- | |||
- | On a trouvé que le bluetooth était une bonne alternative à condition que l'on n'est pas trop de soucis lors de la phase de test. | ||
- | \\ | ||
- | \\ | ||
- | ==== Interface ==== | ||
- | La réalisation de l' | ||
- | La création de l' | ||
- | {{ : | ||
- | \\ | ||
- | Une fois que vous avez fait l' | ||
- | \\ | ||
- | \\ | ||
- | __Connexion en Bluetooth: | ||
- | {{ : | ||
- | __Test pour allumer la led sur l' | ||
- | {{ : | ||
- | __Liste déroulante + indication__: | ||
- | {{ : | ||
- | __Test pour communication via l' | ||
- | {{ : | ||
- | \\ | ||
- | \\ | ||
- | ==== Bluetooth et test ==== | ||
- | |||
- | Le code pour l' | ||
- | < | ||
- | int ledPin = 13; | ||
- | String readString; | ||
- | |||
- | void setup() { | ||
- | Serial.begin(9600); | ||
- | pinMode(ledPin, | ||
- | } | ||
- | |||
- | void loop() { | ||
- | while (Serial.available()) { | ||
- | delay(3); | ||
- | char c = Serial.read(); | ||
- | readString += c; | ||
- | } | ||
- | if (readString.length() > 0) { | ||
- | Serial.println(readString); | ||
- | if (readString == " | ||
- | { | ||
- | Serial.println(" | ||
- | } | ||
- | if (readString == " | ||
- | { | ||
- | Serial.println(" | ||
- | } | ||
- | if (readString == " | ||
- | { | ||
- | Serial.println(" | ||
- | } | ||
- | if (readString == " | ||
- | { | ||
- | Serial.println(" | ||
- | } | ||
- | if (readString == " | ||
- | { | ||
- | Serial.println(" | ||
- | } | ||
- | if (readString == " | ||
- | { | ||
- | digitalWrite(ledPin, | ||
- | } | ||
- | if (readString == " | ||
- | { | ||
- | digitalWrite(ledPin, | ||
- | |||
- | } | ||
- | readString = ""; | ||
- | } | ||
- | } | ||
- | |||
- | </ | ||
- | \\ | ||
- | On se connecte maintenant en bluetooth sur l' | ||
- | On lance l' | ||
- | |||
- | {{ : | ||
- | \\ | ||
- | \\ | ||
- | On a donc une interface sur smartphone qui communique avec l' | ||
- | \\ | ||
- | \\ | ||
|[[: | |[[: | ||