Bonjour,
Je poste ici car , je ne vais pas vous le cacher, je suis en difficulté
J'ai pour projet de faire parler un module Emic 2 dans le cadre d'un projet de casque moto gps , ou le casque nous donne la direction grâce a ce module
Mon professeur ayant beaucoup d'éleve a guider, je n'ai pas eu beaucoup d'occasions de lui demander de l'aide
Voila ou j'en suis pour le code
Apres avoir téléversé ce programme dans mon Arduino Uno, j'ouvre mon moniteur série, je rentre les valeurs en question , et rien..Code:#include <SoftwareSerial.h> #define rxPin 2 // Serial input (connects to Emic 2 SOUT) #define txPin 3 // Serial output (connects to Emic 2 SIN) #define ledPin 13 // Most Arduino boards have an on-board LED on this pin char car_recu; // set up a new serial port SoftwareSerial emicSerial = SoftwareSerial(rxPin, txPin); void setup() // Set up code called once on start-up { // define pin modes pinMode(ledPin, OUTPUT); pinMode(rxPin, INPUT); pinMode(txPin, OUTPUT); // set the data rate for the SoftwareSerial port emicSerial.begin(9600); Serial.begin(9600); digitalWrite(ledPin, LOW); // turn LED off emicSerial.print('\n'); // Send a CR in case the system is already up while (emicSerial.read() != ':'); // When the Emic 2 has initialized and is ready, it will send a single ':' character, so wait here until we receive it delay(10); // Short delay emicSerial.flush(); // Flush the receive buffer } void loop() { if (Serial.available()) char car_recu = Serial.read(); if(car_recu == 1){ emicSerial.print('S'); emicSerial.print("Continuey tou droi"); emicSerial.print('\n'); while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command } else if(car_recu == 2){ emicSerial.print('S'); emicSerial.print("toohrney aa drrwat"); emicSerial.print('\n'); while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command } else if(car_recu == 3){ emicSerial.print('S'); emicSerial.print("toohrney aa goshe"); emicSerial.print('\n'); while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command } else if(car_recu == 4){ emicSerial.print('S'); emicSerial.print("fate demi tour avec prudanss"); emicSerial.print('\n'); while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command } else if(car_recu == 5){ emicSerial.print('S'); emicSerial.print("oh rohn poueinn , preneeh la , preue me r , sortie"); emicSerial.print('\n'); while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command } else if(car_recu == 6){ emicSerial.print('S'); emicSerial.print("oh rohn poueinn , preneeh la , de ze m , sortie"); emicSerial.print('\n'); while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command } else if(car_recu == 7){ emicSerial.print('S'); emicSerial.print("oh rohn poueinn , preneeh la , troua z m , sortie"); emicSerial.print('\n'); while (emicSerial.read() != ':'); // Wait here until the Emic 2 responds with a ":" indicating it's ready to accept the next command } }
Je vous demande humblement de l'aide, je ne sais que faire
-----