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

Function blescanSetup

nRFBox_V2/blescan.cpp:29–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27unsigned long debounce_Delay = 200;
28
29void blescanSetup() {
30 Serial.begin(115200);
31 u8g2.setFont(u8g2_font_6x10_tr);
32
33 BLEDevice::init("");
34 scan = BLEDevice::getScan();
35 scan->setActiveScan(true);
36
37 pinMode(BUTTON_PIN_UP, INPUT_PULLUP);
38 pinMode(BUTTON_PIN_DOWN, INPUT_PULLUP);
39 pinMode(BUTTON_PIN_SELECT, INPUT_PULLUP);
40 pinMode(BUTTON_PIN_BACK, INPUT_PULLUP);
41
42
43 for (int cycle = 0; cycle < 3; cycle++) {
44 for (int i = 0; i < 3; i++) {
45 u8g2.clearBuffer();
46 u8g2.setFont(u8g2_font_ncenB08_tr);
47 u8g2.drawStr(0, 10, "Scanning BLE");
48
49 String dots = "";
50 for (int j = 0; j <= i; j++) {
51 dots += " .";
52 setNeoPixelColour("white");
53 }
54 setNeoPixelColour("0");
55
56 u8g2.drawStr(75, 10, dots.c_str());
57
58 u8g2.sendBuffer();
59 delay(300);
60 }
61 }
62
63 scanStartTime = millis();
64 scan->start(scanDuration / 1000, false);
65}
66
67void blescanLoop() {
68 unsigned long currentMillis = millis();

Callers

nothing calls this directly

Calls 1

setNeoPixelColourFunction · 0.85

Tested by

no test coverage detected