Hello. I have my esp32 and ili9341 up and running. I'm not a coder but more of a
play with it till it breaks kind of person
I'm trying to draw a 'HUD' on my display. It's a 320x240 display set to landscape.
I have it very close to what I want but am having difficulty with one piece of code...
//SMALLEST_TOP bars_left
// Draw tick -12th degree
for (int i = 330; i < 350; i += 3)
{
// Coodinates of tick to draw
float sx4 = cos((i - 90) * 0.0174532925);
float sy4 = sin((i - 90) * 0.0174532925);
uint16_t x0 = sx4 * 120 + 160;
uint16_t y0 = sy4 * 120 + 120;
uint16_t x1 = sx4 * 110 + 160; //110 should increment by '1' each time.
uint16_t y1 = sy4 * 110 + 120; // higher number '110' will make the tick shorter.
// Draw tick
tft.drawLine(x0, y0, x1, y1, TFT_BLUE);
}
This code draws 7 lines 3 degrees apart but I'd like them to get smaller by '1' each time
a new line is drawn.
I've tried adding another for loop but the results have been...not what I want lol