Hi,
I am trying to do the following with 2 Nano 33 IoT boards communicating via BLE.
On one side, I have a board with 4 buttons. Each button has an LED ring which is independently controllable. This is currently the Central side.
On the receiving side, when the arduino picks up a signal, it sends the appropriate signal to the robot. This is the peripheral side.
After the robot has completed the task, it will send a signal back to the peripheral. I would like to send a signal back from the peripheral to the central to say "task complete, you are ready to send the next task". This is communicated through which LEDs on the buttons are lit up.
Right now, I have managed to get everything to work except sending that signal from the peripheral back to the Central. I am not sure if this is possible.
My current attempt to get a signal from peripheral to central is:
BLEByteCharacteristic programStatus("19B10002-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);
void setup(){
//other code to set up BLE connection
KUKAService.addCharacteristic(programStatus);
void loop(){
if (condition to send this signal){
characteristic.writeValue((byte)0x01);
}
}
Then on the Central Side, I have:
byte characteristicReading;
void setup(){
//Code to set up BLE connection here
BLECharacteristic programStatus = peripheral.characteristic("19b10002-e8f2-537e-4f6c-d104768a1214");
}
void loop(){
if (programStatus.written()){
characteristicReading = programStatus.Value();
//code to do something here
}
}
What could I do to make this communication work? Thank you