From ab4367992efb69aeb645a5c27567522f4c5fb4c6 Mon Sep 17 00:00:00 2001 From: "Hans P. Reiser" Date: Thu, 4 Apr 2019 23:46:48 +0200 Subject: [PATCH] some more testing --- libraries/SondeLib/Scanner.cpp | 50 ++++++++++++++++++++++++++++++++-- libraries/SondeLib/Scanner.h | 13 ++++++++- 2 files changed, 59 insertions(+), 4 deletions(-) diff --git a/libraries/SondeLib/Scanner.cpp b/libraries/SondeLib/Scanner.cpp index 69a5488..17b21a9 100644 --- a/libraries/SondeLib/Scanner.cpp +++ b/libraries/SondeLib/Scanner.cpp @@ -1,21 +1,65 @@ #include "Scanner.h" #include +#include -#define CHANBW 7.5 -#define SMOOTH 1 +extern U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8; + +#define CHANBW 25 +#define SMOOTH 2 #define STARTF 400000000 #define NCHAN ((int)(6000/CHANBW)) int scanresult[NCHAN]; int scandisp[NCHAN/2]; +#define PLOT_N 120 +#define PLOT_MIN -220 +#define PLOT_SCALE(x) (x=8) { row[8*y]=255; continue; } + row[8*y] = tilepatterns[nbits]; + } +} +/* + * There are 16*8 columns to plot, NPLOT must be lower than that + * currently, we use 120 * 50kHz channels + * There are 8*8 values to plot; MIN is bottom end, + */ +uint8_t tiles[16] = { 0x0f,0x0f,0x0f,0x0f,0xf0,0xf0,0xf0,0xf0, 1, 3, 7, 15, 31, 63, 127, 255}; +void Scanner::plotResult() +{ + uint8_t row[8*8]; + for(int i=0; i +#include +#include +#ifndef inttypes_h + #include +#endif + class Scanner { - public: +private: + void fillTiles(uint8_t *row, int value); + +public: + void plotResult(); void scan(void); };