satan wins

This commit is contained in:
2025-02-08 21:56:11 -05:00
parent f9867c1844
commit bcfc3462fc

View File

@@ -57,10 +57,14 @@ void setup() {
// If you are using RFM95/96/97/98 modules which uses the PA_BOOST transmitter pin, then
// you can set transmitter powers from 5 to 23 dBm:
rf95.setTxPower(23, false);
Serial.println("Please enter your name: ");
}
void loop() {
int ndx = 0;
while (Serial.available() == 0) {}
if (chatName[0] == '\0'){
while (Serial.available() > 0) {
// read the incoming byte:
incomingByte = Serial.read();
@@ -68,6 +72,7 @@ void setup() {
chatName[ndx] = incomingByte;
ndx++;
}
if (chatName[0] != '\0'){
char send_name[RH_RF95_MAX_MESSAGE_LEN] = "";
strcpy(send_name, chatName);
strcat(send_name, " has joined the chat!");
@@ -75,15 +80,13 @@ void setup() {
Serial.print("Welcome ");
Serial.println(chatName);
rf95.send((uint8_t *)send_name, RH_RF95_MAX_MESSAGE_LEN);
}
void loop() {
}
}
memset(receivedChars, '\0', sizeof(receivedChars));
int dataReceived = 0;
int ndx = 0;
while (Serial.available() > 0) {
while (Serial.available() > 0 && chatName[0] != '\0') {
dataReceived = 1;
// read the incoming byte: