MCPcopy Create free account
hub / github.com/cifertech/nRFBox / scannerSetup

Function scannerSetup

VScode Platformio/src/scanner.cpp:191–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190
191void scannerSetup(){
192 Serial.begin(115200);
193
194 esp_bt_controller_deinit();
195 esp_wifi_stop();
196 esp_wifi_deinit();
197
198 u8g2.begin();
199
200 for (byte count = 0; count <= 128; count++) {
201 sensorArray[count] = 0;
202 }
203
204 Serial.println("Starting 2.4GHz Scanner ...");
205 Serial.println();
206
207 SPI.begin(18, 19, 23, 17);
208 SPI.setDataMode(SPI_MODE0);
209 SPI.setFrequency(10000000);
210 SPI.setBitOrder(MSBFIRST);
211
212 pinMode(CE, OUTPUT);
213 pinMode(CSN, OUTPUT);
214
215 pinMode(BUTTON, INPUT_PULLUP);
216
217 disable();
218
219 powerUp();
220 setRegister(_NRF24_EN_AA, 0x0);
221 setRegister(_NRF24_RF_SETUP, 0x0F);
222}
223
224void scannerLoop(){
225

Callers

nothing calls this directly

Calls 3

disableFunction · 0.70
powerUpFunction · 0.70
setRegisterFunction · 0.70

Tested by

no test coverage detected