Ligne 315 : |
Ligne 315 : |
| Après avoir téléchargé votre sketch sur la carte Arduino, pressez le bouton ON/OFF du GPRS shield pour l'allumer; Vous pourrez ensuite voir ce qui s'affiche sur votre Terminal série, le statut des 3 indicateurs LEDs et finalement communiquer avec votre GPRS shield. | | Après avoir téléchargé votre sketch sur la carte Arduino, pressez le bouton ON/OFF du GPRS shield pour l'allumer; Vous pourrez ensuite voir ce qui s'affiche sur votre Terminal série, le statut des 3 indicateurs LEDs et finalement communiquer avec votre GPRS shield. |
| <nowiki> | | <nowiki> |
− | // Serial Relay - Arduino servira d'intermédiaire de | + | // Serial Relay - Arduino < 1.0 |
| + | // Arduino servira d'intermédiaire de |
| // communication série entre votre ordinateur et le | | // communication série entre votre ordinateur et le |
| // shield GPRS (19200 bps 8-N-1) | | // shield GPRS (19200 bps 8-N-1) |
Ligne 345 : |
Ligne 346 : |
| } | | } |
| </nowiki> | | </nowiki> |
− | <font color="red"> | + | |
− | Note:
| + | La version ci-dessous convient pour Arduino 1.0 : |
− | * Assurez vous que vous avez bien installé la librairie [http://arduiniana.org/NewSoftSerial/NewSoftSerial10c.zip NewSoftLibrary].
| + | <nowiki> |
− | * Le préfix "AT" ou "at" doit être présent au début de chaque ligne. Pour terminer une commande, pressez la touche Retour/Enter <CR>. | + | //Serial Relay - pour Arduino 1.0 |
− | </font>
| + | // |
| + | // Arduino will patch a serial link between the computer |
| + | // and the GPRS Shield at 19200 bps 8-N-1 |
| + | //Computer is connected to Hardware UART |
| + | //GPRS Shield is connected to the Software UART |
| + | |
| + | #include <SoftwareSerial.h> // For Arduino 1.0 |
| + | |
| + | SoftwareSerial mySerial(7, 8); // For Arduino 1.0 |
| + | |
| + | void setup() |
| + | { |
| + | mySerial.begin(19200); // the GPRS baud rate |
| + | Serial.begin(19200); // the GPRS baud rate |
| + | } |
| + | |
| + | void loop() |
| + | { |
| + | if(Serial.available()) |
| + | { |
| + | char c = Serial.read(); |
| + | mySerial.print(c); |
| + | } |
| + | else if(mySerial.available()) |
| + | { |
| + | char c = mySerial.read(); |
| + | Serial.print(c); |
| + | } |
| + | } |
| + | </nowiki> |
| + | |
| + | |
| + | Notes: |
| + | * Pour une version Arduino IDE: |
| + | ** <font color="red">< 1.0 : assurez vous que vous avez bien installé la librairie [http://arduiniana.org/NewSoftSerial/NewSoftSerial10c.zip NewSoftLibrary].</font> |
| + | ** >= 1.0: pas besoin d'installer la librairie NewSoftSerial, elle est disponible dans l'installation par défaut comme SoftwareSerial. |
| + | * Le préfix "AT" ou "at" doit être présent au début de chaque ligne. Pour terminer une commande, pressez la touche Retour/Enter <CR>. |
| | | |
| === Version Améliorée du Sketch === | | === Version Améliorée du Sketch === |