Problems receiving data from Processing using HC05 BT-module


hello everyone,

we got stuck receiving wrong data processing on our arduino uno. need 4 different values control system. works other way though: getting data arduino processing has not been problem. got data straight away after sending command in processing, random numbers far. strangely width never greater 8 bits, e.g. seems read 1 byte buffer.

baud rate 9600 , avoided using serial.print() troubleshoot @ 1 point thought might interfere transmission. in setup routine import library softwareserial.h.

what have tried far:
-using bytes, chars, ints , string on both ends.
-using serial.parseint() instead of serial.read() data buffer

code: [select]

void getbluetooth() {

  if (serial.available() >= message_bytes)
  {
    //if (serial.read() == header) {
      int receivedmsg = (serial.read());  //programm

      serial.print("received: ");
      serial.println(receivedmsg);
      if (decryptmsg(receivedmsg) != -1) {
        programm = decryptmsg(receivedmsg);

        //achtung serial.prints() auskommentieren für eigentliche anwendung, schreibt sonst auf bt
        serial.println("succesful msg ->" + programm);
      } else {
        serial.println("failed msg!");
    //  }
    }
  }
}

what "wrong data" mean?


Arduino Forum > Using Arduino > Interfacing w/ Software on the Computer > Problems receiving data from Processing using HC05 BT-module


arduino

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts