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édenteProchaine révisionLes deux révisions suivantes | ||
tel0026 [2017/04/28 11:26] – simon | tel0026 [2017/05/07 14:15] – simon | ||
---|---|---|---|
Ligne 72: | Ligne 72: | ||
+SENM: | +SENM: | ||
OK | OK | ||
+ | </ | ||
+ | |||
+ | === Erreurs possibles === | ||
+ | La page 16/23 du [[http:// | ||
+ | < | ||
+ | Error_code (hex) | Explanation | ||
+ | ------------------------------------------------------------------------ | ||
+ | 0 | AT command error | ||
+ | 1 | The result is default value | ||
+ | 2 | PSKEY write error | ||
+ | 3 | Device | ||
+ | 4 | Device name is 0 byte | ||
+ | 5 | Bluetooth address: NAP is too long | ||
+ | 6 | Bluetooth address: UAP is too long | ||
+ | 7 | Bluetooth address: LAP is too long | ||
+ | 8 | PIO port mask length is 0 | ||
+ | 9 | Invalid PIO port | ||
+ | A | Device class is 0 byte | ||
+ | B | Device class is too long | ||
+ | C | Inquire Access Code length is 0 | ||
+ | D | Inquire Access Code is too long | ||
+ | E | Invalid Inquire Access Code | ||
+ | F | Pairing password is 0 | ||
+ | 10 | Pairing password is too long (more than 16 bytes) | ||
+ | 11 | Role of module is invalid | ||
+ | 12 | Baud rate is invalid | ||
+ | 13 | Stop bit is invalid | ||
+ | 14 | Parity bit is invalid | ||
+ | 15 | No device in the pairing list | ||
+ | 16 | SPP is not initialized | ||
+ | 17 | SPP is repeatedly initialized | ||
+ | 18 | Invalid inquiry mode | ||
+ | 19 | Inquiry timeout | ||
+ | 1A | Address is 0 | ||
+ | 1B | Invalid security mode | ||
+ | 1C | Invalid encryption mode | ||
</ | </ | ||
Ligne 156: | Ligne 192: | ||
at+state? | at+state? | ||
+STATE: | +STATE: | ||
- | at+mrad? | + | at+mrad? |
- | +MRAD: | + | +MRAD: |
- | at+fsad=98d3, | + | at+fsad=98d3, |
- | OK | + | OK //OK = oui |
- | at+link=98d3, | + | at+link=98d3, |
OK | OK | ||
(réception de ce que le module slave envoit!) | (réception de ce que le module slave envoit!) | ||
</ | </ | ||
- | ===== Erreurs possibles | + | ==== Programmes Arduino |
- | La page 16/23 du [[http://image.dfrobot.com/ | + | Maintenant que nous avons configurés deux modules pour qu'ils se connectent ensemble, nous pouvons les utiliser chacun sur une Arduino et faire communiquer les deux Arduino ensemble. |
- | < | + | |
- | Error_code (hex) | + | * [[allumer une led via bluetooth]] |
- | ------------------------------------------------------------------------ | + | * [[Gestion de 3 leds via bluetooth]] |
- | 0 | AT command error | + | |
- | 1 | + | === Mise en place === |
- | 2 | PSKEY write error | + | * Arduino " |
- | 3 | Device | + | * Une [[https:// |
- | 4 | Device name is 0 byte | + | * Avec un [[https://www.dfrobot.com/ |
- | 5 | Bluetooth address: NAP is too long | + | * Sur lequel on met un [[https://www.dfrobot.com/product-360.html|TEL0026]] |
- | 6 | Bluetooth address: UAP is too long | + | |
- | 7 | Bluetooth address: LAP is too long | + | |
- | 8 | PIO port mask length | + | * Une [[https:// |
- | 9 | Invalid PIO port | + | * Avec un [[https:// |
- | A | Device class is 0 byte | + | * Sur lequel on met une [[https:// |
- | B | Device class is too long | + | |
- | C | Inquire Access Code length is 0 | + | <WRAP center round important 60%> |
- | D | Inquire Access Code is too long | + | **TODO:** Ajouter photos! |
- | E | Invalid Inquire Access Code | + | </ |
- | F | Pairing password is 0 | + | |
- | 10 | Pairing password is too long (more than 16 bytes) | + | === Programme " |
- | 11 | Role of module is invalid | + | <code c> |
- | 12 | Baud rate is invalid | + | /* Minimal code for testing bluetooth module TEL0026 with a button |
- | 13 | Stop bit is invalid | + | |
- | 14 | Parity bit is invalid | + | This program must be used with " |
- | 15 | No device in the pairing list | + | |
- | 16 | SPP is not initialized | + | The circuit |
- | 17 | SPP is repeatedly initialized | + | TEL0026 and button are plugged on Nano I/O Shield |
- | 18 | Invalid inquiry mode | + | |
- | 19 | Inquiry timeout | + | Created 2017 by Simon Lefort. |
- | 1A | Address is 0 | + | */ |
- | 1B | Invalid security mode | + | |
- | 1C | Invalid encryption mode | + | int buttonPin = 8; // |
+ | |||
+ | void setup() { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | int val = digitalRead(buttonPin); | ||
+ | | ||
+ | |||
+ | if (val == HIGH) { | ||
+ | | ||
+ | // | ||
+ | } | ||
+ | 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.txt · Dernière modification : 2020/08/09 13:03 de 127.0.0.1