Pages: [1]   Go Down
Author Topic: Reliable response using SET command  (Read 315 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm using the Arduino Bluetooth board to pair/store the addresses of known devices in EEPROM. I've been trying to use the SET command to echo the settings of the BlueGiga radio, but the response is incomplete; specifically in the SET BT PAIR field, which is exactly what I need. Sometimes the complete pairing information appears, other times the addresses are simply cut off partway through, or do not appear at all. In all cases, the first paired device does not even appear.

Has anyone gotten reliable output using the SET command? If so, how did you implement it? My serial read routine is working correctly and this command seems to be the only one that is giving me trouble. Thanks.

Here's a code snippet:


  int j=eeprom_scratch_idx;
  char tmp_b;

  digitalWrite(ledPin, HIGH); // set led HIGH
  delay(2000);  
  Serial.print("+++");
  delay(2000);

  Serial.println("SET");
    
  for (int i=0; i <= 10; i++){
    delay(1000);
    while (Serial.available() > 0 && j <512) {  
         //inByte = getbyte();  // get incoming byte
         //EEPROM.write(j, inByte);
         tmp_b = getbyte();
           EEPROM.write(j,tmp_b);
           j++;
    }
    delay(1000);
  }

  delay(2000);
  Serial.print("+++");
  delay(2000);
Logged

Pages: [1]   Go Up
Jump to: