wwatson4506 / Ra8876LiteTeensy

Teensy RA8876 Driver
14 stars 6 forks source link

Gesture Engine Code #11

Open K7MDL2 opened 2 years ago

K7MDL2 commented 2 years ago

I have been using your library since Spring of 2021 on my RA8876 7" for RF spectrum display and waterfall for a Teensy based SDR transceiver project. I take advantage of the Bit Transfer Engine to save a lot of CPU time scrolling blocks of graphics.

I wanted full touch capability, physical knobs and buttons are optional. Like the RA8875 I noted there was little support for gestures and comments in the library code that it did not work well. I observed the same problem so in spring 2021 I wrote my own gesture engine and button handler (long and short press) that uses a table of defined hotspots and calls a function. It has been working very well for several of us.

The gesture engine part handles 1 to 3 finger swipes, drags up and down, and pinch and zoom. I am not using the Pinch and zoom right now and that can likely use some more tuning. The drags, touches, and swipes have been working very smooth for several folks for months now.

I am not much into how to build a proper library. Maybe you will or someone seeing this will find it useful. The code example is a file from my SDR Radio Project. The files names are UserInput.h and UserInput.cpp.

It supports both the TeensyDuino version RA8875 ( use 4.3" SPI) and this RA8876 library as I use both display types. A #define chooses which display controller.

Below is a pic of the radio interface during a ham radio contest weekend with lots CW and data mode signals. This is on a 4.3" RA8875 display but the results are the same on the RA8876 7".

I use #define USE_RA8875 to select between the 2 displays along with #define for touch_rotation. I define most of my user settings in the files RadioConfig.h and SDR_Data.h in case something needs more context. The display at 1024 pixel and 1 pixel per bin is showing 1/4 of the spectrum contained in a 4096IQ FFT data array using a sample rate of 96KHz. It takes about 80ms to draw that spectrum window content. using OpenAudio_Library 32bit Floating Point object, and upgrade from the old 16bit integer lib.

20220211_223350