korekta spectral sensor
This commit is contained in:
@@ -60,6 +60,7 @@ int GraphHeight = 32;
|
|||||||
int GrapWidth = 20;
|
int GrapWidth = 20;
|
||||||
float ReadValues[6] = {0, 0, 0, 0, 0, 0};
|
float ReadValues[6] = {0, 0, 0, 0, 0, 0};
|
||||||
float maxValue = 0.0;
|
float maxValue = 0.0;
|
||||||
|
float minValue = 0.0;
|
||||||
float test_vle = 1.0;
|
float test_vle = 1.0;
|
||||||
char FloatInChar[20];
|
char FloatInChar[20];
|
||||||
char ChValue[20];
|
char ChValue[20];
|
||||||
@@ -257,7 +258,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
display.setRotation(0);
|
display.setRotation(0);
|
||||||
|
|
||||||
//show relative calculated graph
|
//show relative calculated values graph
|
||||||
if (menu_number == 3 || menu_number == 7 ){
|
if (menu_number == 3 || menu_number == 7 ){
|
||||||
maxValue = 0;
|
maxValue = 0;
|
||||||
drawControls();
|
drawControls();
|
||||||
@@ -332,7 +333,7 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//show raw data relative graph
|
//show relative raw data graph
|
||||||
if (menu_number == 4 || menu_number == 8 ){
|
if (menu_number == 4 || menu_number == 8 ){
|
||||||
maxValue = 0;
|
maxValue = 0;
|
||||||
drawControls();
|
drawControls();
|
||||||
@@ -341,12 +342,15 @@ void loop() {
|
|||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
maxValue = max(maxValue, ReadValues[i]);
|
maxValue = max(maxValue, ReadValues[i]);
|
||||||
}
|
}
|
||||||
HeightRed = int((RawRed / maxValue) * GraphHeight);
|
for (int i = 0; i < 5; i++) {
|
||||||
HeightOrange = int((RawOrange / maxValue) * GraphHeight);
|
minValue = min(minValue, ReadValues[i]);
|
||||||
HeightYellow = int((RawYellow / maxValue) * GraphHeight);
|
}
|
||||||
HeightGreen = int((RawGreen / maxValue) * GraphHeight);
|
HeightRed = int(((RawRed + abs(minValue)) / (maxValue + abs(minValue)) * GraphHeight);
|
||||||
HeightBlue = int((RawBlue / maxValue) * GraphHeight);
|
HeightOrange = int(((RawOrange + abs(minValue)) / (maxValue + abs(minValue)) * GraphHeight);
|
||||||
HeightViolet = int((RawViolet / maxValue) * GraphHeight);
|
HeightYellow = int(((RawYellow + abs(minValue)) / (maxValue + abs(minValue)) * GraphHeight);
|
||||||
|
HeightGreen = int(((RawGreen + abs(minValue)) / (maxValue + abs(minValue)) * GraphHeight);
|
||||||
|
HeightBlue = int(((RawBlue + abs(minValue)) / (maxValue + abs(minValue)) * GraphHeight);
|
||||||
|
HeightViolet = int(((RawViolet + abs(minValue)) / (maxValue + abs(minValue)) * GraphHeight);
|
||||||
|
|
||||||
|
|
||||||
display.setCursor(1 * GrapWidth -10, 10);
|
display.setCursor(1 * GrapWidth -10, 10);
|
||||||
|
|||||||
Reference in New Issue
Block a user