Replies: 6 comments 1 reply
-
I found the solution by myself, I had to use the getvalue after get dirty, I post the working code for the ili9341 for time display and play showing a green triangle when play is pressed and replaced by a red one when stop is pressed maybe that can be useful for someone #include <Control_Surface.h>
USBMIDI_Interface usbmidi;
#include <SPI.h>
#include <ILI9341_t3.h>
// The display uses hardware SPI, plus #9 & #10
#define TFT_CS 10
#define TFT_DC 9
#define rst -1
//ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC);
ILI9341_t3 tft(TFT_CS, TFT_DC);
Bank<4> bank(2); // Create a new bank with two tracks per bank
MCU::TimeDisplay timedisplay = {};
NoteValue play {MCU::PLAY};
void setup() {
Serial.begin(11500);
tft.begin();
tft.fillScreen(ILI9341_BLACK),
// Correct relative mode for MCU rotary encoders
RelativeCCSender::setMode(MACKIE_CONTROL_RELATIVE);
Control_Surface.begin();
}
void loop() {
tft.setRotation(1);
tft.setCursor(0, 0);
tft.setTextSize(2);
tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
if (timedisplay.getDirty()) {
// Print it
tft.print(timedisplay);
// Clear the dirty flag to acknowledge the change
timedisplay.clearDirty();
}
////play display
tft.setCursor(0, 60);
tft.setTextSize(3);
tft.setTextColor(ILI9341_WHITE, ILI9341_BLACK);
if (play.getDirty()) {
if (play.getValue() >0){
//tft.println ("PLAY");
tft.fillTriangle(5, 30, 30, 40, 5, 50, ILI9341_GREEN);
}
else {
tft.fillTriangle(5, 30, 30, 40, 5, 50, ILI9341_RED);
}
// Clear the dirty flag to acknowledge the change
play.clearDirty();
}
Control_Surface.loop();
}
|
Beta Was this translation helpful? Give feedback.
-
hi @tttapa I print a green triangle when I got the play get dirty receiving data but this doesn't t work each time if (play.getDirty()) {
if (play.getValue() >0){
tft.fillTriangle(5, 30, 30, 40, 5, 50, ILI9341_GREEN);
}
else {
tft.fillTriangle(5, 30, 30, 40, 5, 50, ILI9341_RED);
}```
second question it seems that lcd doesn't t have a get dirty option, how should I get the tracks name?
thanks |
Beta Was this translation helpful? Give feedback.
-
Hola, debes usar el play.clearDirty(), asi se limpiara la bandera para cuando apagues el play. El nombre de pista se obtiene con getText() si mal no recuerdo, creo que hay unos ejemplos donde obtiene el nombre y lo imprime en oled |
Beta Was this translation helpful? Give feedback.
-
Cleardity al finalizar el getdirty |
Beta Was this translation helpful? Give feedback.
-
yes I tried this but didn't t change anything! |
Beta Was this translation helpful? Give feedback.
-
ok I found where is my problem, for my sliders I need to refresh screen //update the LCD display at the set frame rate
if ((millis() - previousMillis) > (200.0 / (float)LCD_FRAME_RATE))
{
updateDisplay();
previousMillis = millis();
}
}```
and for the callback of play record stop... it works nicely if I use previousmilis > 50
when I use 200 it s like if my tft missed the data, If anyone as a solution that could be cool! |
Beta Was this translation helpful? Give feedback.
-
hi, can someone help me using get dirty with midi note?
i tied like this
but my screen always display my design even if play is not running in daw
Beta Was this translation helpful? Give feedback.
All reactions