Tried this:
uint32_t keylisten = 1;
if (Serial1.available() > 0){
while (keylisten = 1){
sendkey((uint32_t)sharedindex);
if (Serial1.available() >= 4){
othersharedIndex = othersharedIndex | Serial1.read() << 24;
othersharedIndex = othersharedIndex | Serial1.read() << 16;
othersharedIndex = othersharedIndex | Serial1.read() << 8;
othersharedIndex = othersharedIndex | Serial1.read();
Serial.println("My partner's Shared Index is:");
keylisten = 0;
}
}
}
I think my problem is (probably) in the receiving and perhaps what I need is a loop that keeps sending until someone has the answer (at this point I only need it to be able to talk to itself over Serial1)
It didn't work (nothing at all displays in monitor, so its still not getting the 4 bytes to move on to printing the shared index)