Weird respond while trying to test RSSI respond time


if don't have time, can read blue part :)

i trying rssi value hc05 , arduino uno time, , got rssi :)

but case is, hard get,
(i plug off arduino, plug off 5 v pin, plug on arduino, press button on hc05 while plugging in 5v pin again, , pull hand button @ command mode; send at+init , at+inq commands[i have press button while sending at+ing code) rssi code :/)
i have code , working
code: [select]
#include <softwareserial.h>
softwareserial btserial(10, 11);



char c = ' ';
boolean nl = true;


void setup() {
 serial.begin(38400);
 btserial.begin(38400);
}

void loop()
{


  if (btserial.available())
  {
    c = btserial.read();
    serial.write(c);
  }

  if (serial.available())
  {
    c = serial.read();
    btserial.write(c);

   if (nl) {
      serial.print(">");
      nl = false;
    }
    serial.write(c);
    if (c == 10) {
      nl = true;
    }
  }
}



i need automatic , continuous. so; firstly, though that
code: [select]
#include <softwareserial.h>
softwareserial btserial(10, 11);



char c = ' ';
string command="at+init";
string command3="at+inqm=1,1,48";
string command2="at+inq";
boolean nl = true;


void setup() {
 serial.begin(38400);
 btserial.begin(38400);

btserial.println(command);
 if (btserial.available())
  {
    c = btserial.read();
    serial.write(c);
  }
btserial.println(command3);
 if (btserial.available())
  {
    c = btserial.read();
    serial.write(c);


}
}
void loop()
{
  
btserial.println(command2);

  
  if (btserial.available())
  {
    c = btserial.read();
    serial.write(c);
  }

 
  if (serial.available())
  {
    c = serial.read();
    btserial.write(c);

  
   if (nl) {
      serial.print(">");
      nl = false;
    }
    serial.write(c);
    if (c == 10) {
      nl = true;
    }
  }
}

did not work :/

then though might because timing case , entering @ mode technique(basically though code works @ wrong times)

so, decided maybe system send at+inq command @ every, example, 30 seconds work.


i though parallel loop works timer job. after googling, learned double loop not work.

then, learned there called "timer". checked it, seemed little complicated, looked trough reference find alternative.

i found millis() function , example code. planned make code sends commands based on function, if(3000<millis()<4000) something...

but case is, i don't know how takes 1 rssi value. built experiment code inserting example code working one

code: [select]
#include <softwareserial.h>
softwareserial btserial(10, 11);

unsigned long time;

char c = ' ';
boolean nl = true;


void setup() {
 serial.begin(38400);
 btserial.begin(38400);
}

void loop()
{


  if (btserial.available())
  {
    c = btserial.read();
    serial.write(c);
       time = millis();
  //prints time since program started
  serial.println(time);
  delay(500);
  }


  if (serial.available())
  {
    c = serial.read();
    btserial.write(c);


   if (nl) {
      serial.print(">");
      nl = false;
    }
    serial.write(c);
    if (c == 10) {
      nl = true;
    }
  }

}



however, when started entering at+state? command, respond is



and have no idea next :/


edİt= colours


quote
you can read yellow part
no, can't. dumbass expect people able read yellow on white.

quote
and have no idea next
stop anonymous printing. have no idea printing. given character part of bluetooth output or digit printing millis()'s output?

you have no idea. so, don't print crap way.


Arduino Forum > Using Arduino > Programming Questions > Weird respond while trying to test RSSI respond time


arduino

Comments

Popular posts from this blog

Error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode - Raspberry Pi Forums

class MPU6050 has no member named begin

missing filename after '-o'