my thermal image is mirrored on my display, here is the loop portion that displays the data. Is there a way to edit the "for (uint8_t w=0; w<32; w++)" to display mirrored, I tried putting some different starting values in and subtracting, but I don't understand the code well enough. Or is there another way to manipulate the w value to display from right to left.
with rotation and camera placement I get up and down correctly.
void loop() {
delay(100);
gfx->setCursor(0,0);
if (mlx.getFrame(frame) != 0) {
Serial.println("Failed");
return;
}
gfx->println();
gfx->println();
for (uint8_t h=0; h<24; h++) {
for (uint8_t w=0; w<32; w++) {
float t = frame[h*32 + w];
#ifdef PRINT_TEMPERATURES
gfx->print(t, 1);
gfx->print(", ");
#endif
#ifdef PRINT_ASCIIART
char c = '&';
if (t < 20) c = ' ';
else if (t < 23) c = '.';
else if (t < 25) c = '-';
else if (t < 27) c = '*';
else if (t < 29) c = '+';
else if (t < 31) c = 'x';
else if (t < 33) c = '%';
else if (t < 35) c = '#';
else if (t < 37) c = 'X';
gfx->print(c);
#endif
}
gfx->println();
//gfx->setCursor(0,0);
}
}
thank you
I am trying to flip an image on a tft from mlx90640 data
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- nitrousbob
- Posts: 15
- Joined: Sun Mar 11, 2018 1:43 pm
- sj_remington
- Posts: 998
- Joined: Mon Jul 27, 2020 4:51 pm
Re: I am trying to flip an image on a tft from mlx90640 data
You can reverse right and left by modifying the fast-changing array index.
This
could be changed to
This
Code: Select all
for (uint8_t w=0; w<32; w++) {
float t = frame[h*32 + w];
Code: Select all
for (uint8_t w=0; w<32; w++) {
float t = frame[h*32 + (31-w)];
- nitrousbob
- Posts: 15
- Joined: Sun Mar 11, 2018 1:43 pm
Re: I am trying to flip an image on a tft from mlx90640 data
Thank you so much, I wasnt sure where I could manipulate that variable.
Please be positive and constructive with your questions and comments.