Member #429134

Member Since: April 15, 2013

Country: United States

  • Product WRL-09358 | about a year ago

    Hi, I have problems with bluetooth mate parity, I put this script:

    //#include  
    #include 
    
    int bluetoothTx = 2;  // TX-O pin of bluetooth mate, Arduino D2
    int bluetoothRx = 3;  // RX-I pin of bluetooth mate, Arduino D3
    int ledPin=13;
    SoftwareSerial bluetooth(bluetoothTx, bluetoothRx);
    
    void setup()
    {
      pinMode(ledPin, OUTPUT);
      digitalWrite(ledPin, LOW);
      Serial.begin(9600);  // Begin the serial monitor at 9600bps
    
      bluetooth.begin(115200);  // The Bluetooth Mate defaults to 115200bps
      delay (300);
      bluetooth.print("$$$");  // Enter command mode
      delay(100);  // Short delay, wait for the Mate to send back CMD
      bluetooth.println("U,9600,N");  // Temporarily Change the baudrate to 9600, no parity
      // 115200 can be too fast at times for NewSoftSerial to relay the data reliably
      bluetooth.begin(9600);  // Start bluetooth serial at 9600
        digitalWrite(ledPin, LOW);
    }
    
    void loop()
    {
      if(bluetooth.available())  // If the bluetooth sent any characters
      {
        char toSend = (char)bluetooth.read();
    
        if (toSend == 'h'){
            digitalWrite(ledPin, HIGH);
        }
    
        if(toSend == 'l'){
            digitalWrite(ledPin, LOW);
        }
        // Send any characters the bluetooth prints to the serial monitor
        Serial.print(toSend);  
      }
      if(Serial.available())  // If stuff was typed in the serial monitor
      {
        // Send any characters the Serial monitor prints to the bluetooth
          char toSend=(char)Serial.read();
          bluetooth.print(toSend);
      }
      }
      // and loop forever and ever!
    

    And in the Serial Monitor , I put $$$, and D for settings, and after I to inquiry. So when a I put C, appear Trying and next Connect Failed. Someone could help me?

No public wish lists :(