Artificial Horizon display using a gyro

Your patch works perfectly, thank you!!!!!! Speed is acceptable, no flickering.
But there are still random artifacts on the left and top sides. They were before my changes too, but only with this library. Do you have any suggestions?

@imolodkin

Post a copy of your sketch so I can run it and see what is happening.

@imolodkin

Missing pixels in lines is a problem encountered with the new 1.6.12 IDE, I have updated the ILI9341 library on Github to correct this.

@bodmer

I'm really sorry for the delay, didn't get any forum notifications.

I've updated the library and now it works great! Thank you so much for your support!

Hello
i test Demo

// Demo code for artifical horizon display
// Written by Bodmer for a 160 x 128 TFT display
// 15/8/16 GitHub - Bodmer/TFT_ST7735: Arduino graphics library for ST7735 displays with propotional fonts

#include <Adafruit_GFX.h> // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
#define TFT_CS 10
#define TFT_RST 9
#define TFT_DC 8
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
#define TFT_SCLK 13 // set these to be whatever pins you like!
#define TFT_MOSI 11 // set these to be whatever pins you like!

// #include <SPI.h>
// Use ONE of these three highly optimised libraries, comment out other two!
// For S6D02A1 based TFT displays
// #include <TFT_S6D02A1.h> // Bodmer's graphics and font library for S6D02A1 driver chip
// TFT_S6D02A1 tft = TFT_S6D02A1(); // Invoke library, pins defined in User_Setup.h
// GitHub - Bodmer/TFT_S6D02A1: A fast Arduino TFT library for S6D02A1 based displays
// For ST7735 based TFT displays
// #include <TFT_ST7735.h> // Bodmer's graphics and font library for ST7735 driver chip
// TFT_ST7735 tft = TFT_ST7735(); // Invoke library, pins defined in User_Setup.h
// GitHub - Bodmer/TFT_ST7735: Arduino graphics library for ST7735 displays with propotional fonts

// For ILI9341 based TFT displays (note sketch is currently setup for a 160 x 128 display)
//#include <TFT_ILI9341.h> // Bodmer's graphics and font library for ILI9341 driver chip
//TFT_ILI9341 tft = TFT_ILI9341(); // Invoke library, pins defined in User_Setup.h
// GitHub - Bodmer/TFT_ILI9341: A fast Arduino IDE compatible graphics and fonts library including a driver for the ILI9341 based TFT displays.

Arduino Version 1.6.12

by Test

C:\Users\Heli\Desktop\Demo_artificial_horizon_7\Demo_artificial_horizon_9.ino:10:95: fatal error: TFT_S6D02A1.h: No such file or directory

#include <TFT_S6D02A1.h> // Bodmer's graphics and font library for S6D02A1 driver chip

^

compilation terminated.

exit status 1
Fehler beim Kompilieren für das Board Arduino/Genuino Uno.

I am a beginner
And look for the error.
For many days

Thanks for any help

Trying to think of things which could slow down a lot of writes to an LCD, I see that you have quite a few pins in use, but ?no? mention of pullup resistors. Does the screen or adafruit recommend anything ?
Your code looks as though it is going to presume 30k pullup built in, which might require comms to go slower than their best or be less reliable than ideal, especially if you have more than 6 inches of cabling from microcontroller to display. Various opinions abound about adding external pullup resistors from a digital pin to arduino Vcc, but I found 10kOhm or 3.3kOhm more likely to work than none at all and necessary when using a few feet of cables.

Hello,
Was a copy error.
There was wrong data in the file.
For whatever reason.
Thanks

Hello,
hm work only with Arduino Duo
i have Arduino Due ;o(
But it is fine
thx
Ratlos

@olf5

As you are a beginner I would start by creating a simpler sketch! For example just draw a line though the centre of the screen at an angle that is output by the sensor. You will need to store the end coordinates of the last drawn line so you can erase it by over-writing with background before drawing the new line.

Hi there ...
Does anyone here?
I want to run this code for horizon indicator, any other updates?
Hey guys, is this topic active?

Hello Bodmer:

I have been using your TFT eSPI library with a M5stack ESP32 320x240. Works quite well ! I was wondering - why not make a artificial horizon indicator using the sprites. The pitch scale and sky+earth image would be replotted as a sprite with the wings symbol static (along with other features). What do you think ?

1 Like

@DrWino

I did try this and it works. I will tidy up the sketch and include it as an example. I also created a simple animated compass with moving needle and dial which I might add.

1 Like

Very good. Can you send me the example ? Does not matter if it is not too finished - it will a good exercise to figure out how you did this ! Thanks.

1 Like

Hello BOdmer! I am using the ILI9341_due Library and the same solved problem on post #46 appears again. Can you help me? Som missed pixels in the border of moving Indicator.

Tahnks!

Would this code be hard to convert to be used on a higher resolution display (in order to show some other values out of the AH) and with a STM32 board?

Hello Bodmer. Any chance of getting the sprite example. Confused about how the sprite programming works. Thanks

1 Like

bodmer:
@DrWino

I did try this and it works. I will tidy up the sketch and include it as an example. I also created a simple animated compass with moving needle and dial which I might add.

I am curious if you could provide examples to the hardware and sketch. Is there a hardware design online to the display and the wiring? Thank you in advance.

Ah, I forgot about that post. I will search out the sketches and upload it within the next 24 hours.

Here's the compass demo, draws the compass in a Sprite then plots it to screen. Demo shows compass continuously rotating. Not sure where I put the artificial horizon demo... but I will find it.

Runs on ESP8266 or ESP32 with TFT_eSPI library.

Compass.zip (2.03 KB)

1 Like

Hi bodmer
I am happy to have you.
I want to make on RC SCALE HELI
I did a lot of web search.
Then I found your post
I'm with UNO and ST7735 TFT
Successful upload of demo file.
It's so cool
My videos Test - YouTube
Is there any ST-7789 library?
I want to apply it to ST7768 IPS TFT.
And I do not know how to work with the Gyro MP-6050.
Please let me know if there is a solution.