Nano 33 BLE Rev 2 Bluetooth Transmitter

Yes I have 2 nano 33 BLE rev 2, I want one to send the status of a digital input to the other but I cant even get them to connect. I didnt see a good example of 2 arduinos talking to each other. This code was weitten by chat gpt but I looked through it and i dont see why it wouldnt work unless there is something about the actual arduino that wont let it work the way I want it to.