tel0026
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
tel0026 [2017/05/07 14:15] – simon | tel0026 [2020/08/09 13:03] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 206: | Ligne 206: | ||
* [[allumer une led via bluetooth]] | * [[allumer une led via bluetooth]] | ||
* [[Gestion de 3 leds via bluetooth]] | * [[Gestion de 3 leds via bluetooth]] | ||
- | |||
- | === Mise en place === | ||
- | * Arduino " | ||
- | * Une [[https:// | ||
- | * Avec un [[https:// | ||
- | * Sur lequel on met un [[https:// | ||
- | |||
- | * Arduino " | ||
- | * Une [[https:// | ||
- | * Avec un [[https:// | ||
- | * Sur lequel on met une [[https:// | ||
- | |||
- | <WRAP center round important 60%> | ||
- | **TODO:** Ajouter photos! | ||
- | </ | ||
- | |||
- | === Programme " | ||
- | <code c> | ||
- | /* Minimal code for testing bluetooth module TEL0026 with a button | ||
- | |||
- | This program must be used with " | ||
- | |||
- | The circuit is based on Dreamer Nano V4.1, compatible Arduino Leonardo ( https:// | ||
- | TEL0026 and button are plugged on Nano I/O Shield ( https:// | ||
- | |||
- | Created 2017 by Simon Lefort. | ||
- | */ | ||
- | |||
- | int buttonPin = 8; //button is on pin 8 | ||
- | |||
- | void setup() { | ||
- | Serial.begin(38400); | ||
- | Serial1.begin(38400); | ||
- | } | ||
- | |||
- | void loop() { | ||
- | int val = digitalRead(buttonPin); | ||
- | delay(50); | ||
- | | ||
- | if (val == HIGH) { | ||
- | Serial1.print(" | ||
- | // | ||
- | } | ||
- | else | ||
- | { | ||
- | // | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | === Programme " | ||
- | <code c> | ||
- | /* Minimal code for testing bluetooth module TEL0026 with a led. | ||
- | If we received " | ||
- | |||
- | This program must be used with " | ||
- | |||
- | The circuit is based on Dreamer Nano V4.1, compatible Arduino Leonardo ( https:// | ||
- | TEL0026 and button are plugged on Nano I/O Shield ( https:// | ||
- | |||
- | Created 2017 by Simon Lefort. | ||
- | */ | ||
- | |||
- | int ledPin = 14; | ||
- | int incomingByte = 0; | ||
- | |||
- | void setup() { | ||
- | Serial.begin(38400); | ||
- | Serial1.begin(38400); | ||
- | | ||
- | digitalWrite(ledPin, | ||
- | } | ||
- | |||
- | void loop() { | ||
- | if (Serial1.available() > 0){ | ||
- | incomingByte = Serial1.read(); | ||
- | | ||
- | Serial.print(" | ||
- | Serial.println(incomingByte); | ||
- | | ||
- | if (incomingByte = ' | ||
- | digitalWrite(ledPin, | ||
- | delay(500); | ||
- | } | ||
- | } | ||
- | else{ | ||
- | Serial.println(" | ||
- | digitalWrite(ledPin, | ||
- | delay(500); | ||
- | } | ||
- | } | ||
- | </ | ||
- | |||
- | === Remarques === | ||
- | Ça marche mais j'ai des soucis si je laisse le bouton appuyé. Ça envoie une série de caractères et le " | ||
- | |||
===== Sources ===== | ===== Sources ===== |
tel0026.1494166557.txt.gz · Dernière modification : 2020/08/09 12:59 (modification externe)