I’m new and have already made a GUI. Now I have programmed a text area and it works great graphically. I’m using an Arduino Giga Board with Shield. Everything runs and implements great. Now I would like to display analog values with the text area.
How can I link an analog value in the sketch?
So i think my problem is on the loop where is the funktion " /* Feed LVGL engine */
lv_timer_handler();" in my case i analogread in loop, but display flickers heavily?
Are there basics that I can use? Square Line Studio exports great, but now I want to feed the individual widgets with data. Can anybody help me with this? Thanks!
#include "Arduino_GigaDisplayTouch.h"
#include "lvgl.h"
#include "ui.h"
/* Insert resolution WxH according to your SquareLine studio project settings */
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
Arduino_GigaDisplayTouch Touch;
int analogValue = 0;
void setup() {
Display.begin();
Touch.begin();
ui_init();
}
void loop() {
analogValue = analogRead(A0);
Serial.println(analogValue);
/* Feed LVGL engine */
lv_timer_handler();
}
type or paste code here
So update… i have been tested with an ESP 32 and ST7735 Display and it works great. Seems to be the giga and shield have problems with it, or that libary.
Strange…
i have the Arduino giga board with has ADC from A0-12. So no problem.
i use now a comparator. It works great:
#include "Arduino_GigaDisplayTouch.h"
#include "lvgl.h"
#include "ui.h"
#include "Wire.h"
#include <Adafruit_ADS1X15.h>
/* Insert resolution WxH according to your SquareLine studio project settings */
Arduino_H7_Video Display(800, 480, GigaDisplayShield);
Arduino_GigaDisplayTouch Touch;
Adafruit_ADS1115 ads; /* Use this for the 16-bit version */
void setup() {
Display.begin();
Touch.begin();
Serial.begin(115200);
Wire.begin(); //SDA & SDL
ads.begin();
ads.setGain(GAIN_TWO);
ui_init();
}
void analogRead() {
int16_t adc0;
adc0 = ads.readADC_SingleEnded(0);
Serial.println(adc0);
// Eine kleine Verzögerung, um den seriellen Monitor nicht zu beeinträchtigen
delay(10);
}
void loop() {
/* Feed LVGL engine */
lv_timer_handler();
analogRead();
}`Preformatted text`
also whit declarition in setup, whit pinmode.... it doesn´t work.
type or paste code here