void loop() // run over and over
{//Serial.print("x");
if (flag == 1)
fill_buffer();
if (digitalRead(Call) == HIGH) // Call pin is low i.e. nothing is getting recived
{
// Serial.print("2freeMemory()="); //Serial.println(freeMemory());
//empty_buffer();
// measure_pow();
}
}
void fill_buffer_flag()
{flag = 1;delay(10);}
byte Daughter_Table[4][2];
const int System_ID = 1;
void setup()
{
pinMode(Call, INPUT);
pinMode(Relay1, OUTPUT);
pinMode(Relay2, OUTPUT);
// Open serial communications and wait for port to open:
Serial.begin(115200);
if ( mySerial.available() )//&& ( Buffer[i - 1] != ')' )) // if (serial avilable and buffer not full)
Despite the comment, nothing here would check that the buffer isn't full.
If you happen to receive more than 40 characters then you'll overwrite your array and any number of things, including a reset, are bound to happen.
What's the purpose of the infinite loop at the end of this function? You're going to receive this data and then lock the program up without doing anything with it?
if ( mySerial.available() )//&& ( Buffer[i - 1] != ')' )) // if (serial avilable and buffer not full)
Despite the comment, nothing here would check that the buffer isn't full.
If you happen to receive more than 40 characters then you'll overwrite your array and any number of things, including a reset, are bound to happen.
What's the purpose of the infinite loop at the end of this function? You're going to receive this data and then lock the program up without doing anything with it?
"nothing here would check that the buffer isn't full." - Except for the fact that all the code that references Buffer is commented out....