I have BLE connectivity to the Wio Terminal via Blynk, but…
I have a sketch with multiple user input screens/views activated via buttons/switches and the main screen that loads a full screen sprite to the Wio Terminal screen. I added the BLE to Blynk commands (see below for what I added) and:
Blynk indicates BLE connection established with Wio Terminal,
Sensor LEDs connected to Wio Terminal indicate that the sketch is in the main loop,
Buttons and switches still move me to various UI screens and I can toggle other controls,
Small sprites on the alternate UI screens/views appear to be working properly.
However, the initial full screen sprite is not visible, or repaper if I toggle buttons or switches. I do see the initial screen start as white and immediately fills with black (the sprite has a white background and tft is black). I have no idea where to start on this issue, any thoughts?
added to sketch: #define BLYNK_PRINT Serial #define BLYNK_USE_DIRECT_CONNECT
Some simple(ish) code demonstrating issue and I have identified that just including the libraries for BLE to Blynk communication will destroy the sprites.
#define BLYNK_PRINT Serial
#define BLYNK_USE_DIRECT_CONNECT
//****************************************************************************
//commenting these libabries killsbrings the sprite back to life
//
#include <BlynkSimpleWioTerminal_BLE.h> //comment to make sprite work
#include <BLEDevice.h> //comment to make sprite work
#include <rpcBLEDevice.h> //comment to make sprite work
#include <BLEServer.h> //comment to make sprite work
//****************************************************************************
#include <TFT_eSPI.h>
char auth[] = "***add you token here***"; //need Blynk token to make function
TFT_eSPI tft;
TFT_eSprite spr = TFT_eSprite(&tft); //Main sprite
const unsigned int TFH = TFT_HEIGHT;
const unsigned int TFH2 = TFT_HEIGHT/2;
const unsigned int TFW = TFT_WIDTH;
const unsigned int TFW2 = TFT_WIDTH/2;
void setup() {
BLYNK_PRINT.begin(9600);
BLYNK_PRINT.println("Waiting for connections...");
//Blynk.setDeviceName("Show on Blynk"); //uncomment to make Blynk work
//Blynk.begin(auth); //uncomment to make Blynk work
tft.begin();
tft.setRotation(3);
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_WHITE, TFT_BLACK);
init_screen();
}
void loop() {
//Blynk.run(); //uncomment to make Blynk work
plot_data();
} //end main loop
void init_screen() {
spr.createSprite(TFH,TFW);
spr.fillSprite(TFT_WHITE);
spr.setTextColor(TFT_BLACK, TFT_WHITE);
spr.setCursor(200, 26);
spr.print("spr visible");
spr.drawFastHLine(0,40,320,TFT_MAGENTA);
spr.pushSprite(0, 0);
} //end init_screen
void plot_data() {
spr.fillRect(40, 50, 30, 160, TFT_MAGENTA);
spr.fillRect(80, 50, 30, 160, TFT_BLUE);
spr.fillRect(120, 50, 30, 160, TFT_GREEN);
spr.fillRect(160, 50, 30, 160, TFT_YELLOW);
spr.fillRect(200, 50, 30, 160, TFT_ORANGE);
spr.fillRect(240, 50, 30, 160, TFT_RED);
tft.setCursor(200, 26); //testing tft v. spr
tft.print("tft visible"); //testing tft v spr
spr.pushSprite(0, 0);
} //end plot_data
When you use WiFi or Bluetooth on the Wio Terminal, it is recommended to use small sprites rather than full screen sprites. This is because the Wio Terminal is not left with enough hardware resources to display full screen sprites on the LCD, when running WiFi or Bluetooth at the same time with the LCD. Could you change the initial full screen sprite to a somewhat smaller sprite and check the behavior again?
Thanks @lakshan - possible but there are many other issues with my approach so I am creating two separate UIs. A Blynk UI is coming along but I remain interested in the Wio Terminal as a UI/functional platform that will send formatted data to a network location and allow for full-screen sprites on the Wio Terminal… any direction or reference that establishes such capabilities would be helpful.