const uint8_t num_channels = 100;
uint8_t values[num_channels];
void setup(void) {
Serial.println(F("\n\rRF24/examples/scanner/"));
int i = 0;
while (i < num_channels) {
Serial.print(i >> 4, HEX);
++i;
}
Serial.println();
i = 0;
while (i < num_channels) {
Serial.print(i & 0xf, HEX);
++i;
}
Serial.println();
}
const int num_reps = 100;
bool constCarrierMode = 0;
void loop(void) {
if (Serial.available()) {
char c = Serial.read();
if (c == 'g') {
constCarrierMode = 1;
delay(2);
Serial.println("Starting Carrier Out");
} else if (c == 'e') {
constCarrierMode = 0;
Serial.println("Stopping Carrier Out");
}
}
if (constCarrierMode == 0) {
memset(values, 0, sizeof(values));
int rep_counter = num_reps;
while (rep_counter--) {
int i = num_channels;
while (i--) {
delayMicroseconds(128);
++values[i];
}
}
}
int i = 0;
while (i < num_channels) {
if (values[i])
Serial.print(min(0xf, values[i]), HEX);
else
Serial.print(F("-"));
++i;
}
Serial.println();
}
}
Driver class for nRF52840 2.4GHz Wireless Transceiver.
void startListening(bool resetAddresses=true)
bool testCarrier(uint8_t RSSI=65)
void setChannel(uint8_t channel)
void setAutoAck(bool enable)
void stopListening(bool setWritingPipe=true, bool resetAddresses=true)