Hey. Thanks, With the advice i came a bit further. But now i have the Problem, that i cant compare my float Values. no match for 'operator<=' (operand types are 'String' and 'float')
Heres my programm:
float lowerValue;
float upperValue;
float actualValue = A6;
char printout[4];
byte led = 5;//byte: 8 bit (0-255)
#include <TFT.h>
#include <SPI.h>
#define CS 9
#define DC 0
#define RESET 1
TFT screen = TFT(CS, DC, RESET);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println(analogRead(A6));
screen.begin();
screen.background(0, 0, 0);
screen.stroke(255, 255, 255); //Weiß
screen.text("VOLT", 0, 30);
screen.setTextSize(3);
screen.stroke(255, 0, 0); //Rot
screen.line(0, 40, screen.width(), 40);
}
void loop() {
// put your main code here, to run repeatedly:
if (analogRead(A6) * 1.05)
{
upperValue;
}
if (analogRead(A6) * 0.95)
{
lowerValue;
}
Serial.println((10.0 / 1023 * analogRead(A6))); //Serial Monitor
String actualValue = String(10.0 / 1023 * analogRead(A6));
actualValue.toCharArray(printout, 4);
if (actualValue <= lowerValue || actualValue >= upperValue)
{
{ screen.stroke(255, 255, 255);
screen.text(printout, 0, 50);
}
lowerValue = actualValue;
}
}