| 157 | } |
| 158 | |
| 159 | void analyzerLoop(){ |
| 160 | |
| 161 | ScanChannels(); |
| 162 | |
| 163 | memset(values, 0, sizeof(values)); |
| 164 | |
| 165 | int n = 50; |
| 166 | while (n--) { |
| 167 | int i = N; |
| 168 | while (i--) { |
| 169 | setChannel(i); |
| 170 | startListening(); |
| 171 | delayMicroseconds(128); |
| 172 | stopListening(); |
| 173 | if (carrierDetected()) { |
| 174 | ++values[i]; |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | u8g2.clearBuffer(); |
| 180 | int barWidth = SCREEN_WIDTH / N; |
| 181 | int x = 0; |
| 182 | for (int i = 0; i < N; ++i) { |
| 183 | int v = 63 - values[i] * 3; |
| 184 | if (v < 0) { |
| 185 | v = 0; |
| 186 | } |
| 187 | u8g2.drawVLine(x, v - 10, 64 - v); |
| 188 | x += barWidth; |
| 189 | } |
| 190 | |
| 191 | u8g2.setFont(u8g2_font_ncenB08_tr); |
| 192 | u8g2.setCursor(0, 64); |
| 193 | u8g2.print("1...5...10...25..50...80...128"); |
| 194 | u8g2.sendBuffer(); |
| 195 | |
| 196 | //delay(50); |
| 197 | |
| 198 | } |
nothing calls this directly
no test coverage detected