FlyinFlynn Posted November 27, 2020 Share Posted November 27, 2020 If a 1" display is too large then perhaps you could do what the flight simmers do with their home cockpits - have a single display with instruments displayed in different positions on the screen and mask them with a cover - Your problem then becomes resolution of the display! Those 0.96" displays are only 128x64 pixels ....barely enough for even a single instrument. A 7" panel would do though typically 1024x600 pixels...several instruments all driven from a single Arduino . Quote Link to comment Share on other sites More sharing options...
Andy J Posted November 27, 2020 Share Posted November 27, 2020 Thanks All, just confirms what my brief search found on ebay for these types of display. Will continue to watch this thread with interest. Do like the look of your flight sim Flynn. Briefly looked at the new MS flight sim package the other day but my PC is not close to the minimal requirements for the code. Quote Link to comment Share on other sites More sharing options...
FlyinFlynn Posted November 28, 2020 Share Posted November 28, 2020 ....it's not my simulator Andy.....just a photo off the web. My simulator is based on small jets so it has an FMS and autopilot panel....this one is based on an old 172 Cessna ...pre G1000. Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted November 28, 2020 Author Share Posted November 28, 2020 After a good attempt at programming the weather, i decided it wasnt the way. Instead, i used an imported bitmap (despite my initial comments re such methods!) I opened up the image in post2 cut down it down to just the weather, removed the lines, text etc and saved it as weather.jpg with a size appropriate to the display. Using this site you convert the .jpg to a bitmap text file with a ".c" format (other sites are available!!!) Rename the file weather.h, Copy it into the arduino directory with the files for the display, From the arduino program, use Sketch - Add file - then select weather.h. This adds the file as an additional tab which you can open. Add the line to the main program #include "weather.h" below the other #include lines Add (below the line tft.fillScreen(BLACK); ) tft.drawImageF(137,46,103,88,weather) ; 137, 46 is the location of the top left of the corner of the bitmap, 103,88 is the size of the image (get this from looking inside weather.h). My file is 103 by 88 which results in 99% space being used when it compiles. Any bigger and the compile fails saying memory space exceeded!! As we drew the bitmap early on in the code, the programmed lines are on top. As you can see i have had to shrink my storm to fit the arduino memory (its still 40 miles across if i understand the display correctly)! Thats the good thing about storms, they vary! If i used an ATmega arduino, i could have had a bigger storm. You can see the black dots that made up the dashed lines. All i need to do is change them from black to suit the background which might not be be not "green" but a variation of (the image editing software used may tell you the RGB colours). Nearly there! Edited By dave windymiller on 28/11/2020 20:53:21 Edited By dave windymiller on 28/11/2020 21:07:24 Quote Link to comment Share on other sites More sharing options...
Gary Manuel Posted November 28, 2020 Share Posted November 28, 2020 Forgive me fellas. Apart from being a very satisfying passtime, is there any advantage of using an Arduino / LCD screen over an inkjet printed display? Quote Link to comment Share on other sites More sharing options...
Gary Manuel Posted November 28, 2020 Share Posted November 28, 2020 PS following and learning. Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted November 28, 2020 Author Share Posted November 28, 2020 Disadvantages and advantages. In bright sunlight a inkjet one would probably win! Its not that difficult to make the screen change eg make numbers or lines flash different colours or even move things about. Not being a pilot my knowledge of such displays is limited but im sure someone out there can produce some clever stuff. I was going to introduce that next!!! Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted November 28, 2020 Author Share Posted November 28, 2020 Posted by Steve J on 26/11/2020 11:36:08: I would suggest that you consider moving to a 32 bit processor, e.g. an ESP32 dev board or STM32 'Blue Pill' with an external 3.3V supply. They are a significant step up from the Uno/Nano in terms of processing power, flash and RAM. Sorry Steve, i meant to comment earlier. Thanks i will look at these as a new toy to play with! Certainly look cheap! Cheers Dave Edited By dave windymiller on 28/11/2020 21:19:35 Quote Link to comment Share on other sites More sharing options...
Gary Manuel Posted November 28, 2020 Share Posted November 28, 2020 I'm no pilot either. What you've done so far looks great to me. You've hit the nail on the head by adding movement or changing (flashing) the image. That's something that you can't do on a printout. That's what will impress the observer. Quote Link to comment Share on other sites More sharing options...
Gary Manuel Posted November 28, 2020 Share Posted November 28, 2020 How about a sweeping line, like a windscreen wiper traversing the screen. That would look great. Apologies to purists. Quote Link to comment Share on other sites More sharing options...
Ron Gray Posted November 29, 2020 Share Posted November 29, 2020 Posted by Gary Manuel on 28/11/2020 20:51:05: Forgive me fellas. Apart from being a very satisfying passtime, is there any advantage of using an Arduino / LCD screen over an inkjet printed display? Here’s the one on my SIG Rascal, nowhere near as clever as Daves’! Lights off Lights on Quote Link to comment Share on other sites More sharing options...
FlyinFlynn Posted November 29, 2020 Share Posted November 29, 2020 Posted by dave windymiller on 28/11/2020 20:43:55: You can see the black dots that made up the dashed lines. All i need to do is change them from black to suit the background which might not be be not "green" but a variation of (the image editing software used may tell you the RGB colours). Nearly there! Would it not be easier to just go back and delete the relevant black blobs rather than re-painting them green? You also may not have the memory room to make new green circles. I notice that the white dashes need to stay visible. Brilliant solution to the storm...I couldn't see a way of generating the fuzzy edges either. Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted November 29, 2020 Author Share Posted November 29, 2020 If i just delete the blobs, the white line become continuous. All i did was change the colour of the blob as originally programmed to match what was below, not re paint them a second time! Ive finished this display and figured out how to get a better photo too! The problem i have re animation is knowing what should change and how fast etc. Im sure theres video available to assist such projects. To give a small amount of (made up) animation i have made the 84 and the green arrow toggle red/green on a 1 sec basis by adding this code to the void loop() area void loop() { // green 84 tft.setTextColor(GREEN); tft.setTextSize(2) ; tft.setCursor(200,15) tft.println("84" ) ; // red arrow tft.drawLine(10, 35, 25, 45, RED) ; tft.drawLine(10, 35, 12, 41, RED) ; tft.drawLine(10, 35, 17, 35, RED) ; delay (1000) ; // Red 84 tft.setTextColor(RED); tft.setTextSize(2) ; tft.setCursor(200,15) ; tft.println("84" ) ; // green arrow tft.drawLine(10, 35, 25, 45, GREEN) ; tft.drawLine(10, 35, 12, 41, GREEN) ; tft.drawLine(10, 35, 17, 35, GREEN) ; delay (1000) ; } This approach is simple but limited as the program is governed by 1 second waits. A better way is by use of the Millis() command (see here) rather than delay which would allow various and independent flashes or other timed events. As for moving or sweeping, older weather displays i understand used to sweep and the monochrome "weather" would be re-brightened as the radar beam line swept past it. Its possible to do this but would be hard work with a bitmap involved. If my mig 144 (or similar given that its still secret!) has such a display i would have a go. In the mean time ive got several other projects including a 1/7 f86 sabre which of course has no such displays (dohh!) Hopefully theres enough info in this thread for others to have a go and get even better results!. Feel free to post results here. There are real time compass chips, xyz accelerometers and all sorts of other fancy modules that are available. You could even build a working attitude display! Skys the limit! Cheers Dave Edited By dave windymiller on 29/11/2020 21:15:41 Quote Link to comment Share on other sites More sharing options...
Max Z Posted November 30, 2020 Share Posted November 30, 2020 Hi Dave, I am following your efforts with interest. A while ago I have been dabbling with monochrome displays, and at some point came across THIS useful internet tool to convert pixel pictures into a matrix of hex codes that could be used directly with the drawBitmap command (U8glib library). Maybe it is also useful with the colored images you are creating? Keep up the good work, cheers, Max. Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted November 30, 2020 Author Share Posted November 30, 2020 Hiya Max. Thanks, i will look at it. Looks like a very similar tool to what i used. One thing i wanted to add to this thread is the list of commands available can be found in:- **LINK** Cheers Dave Quote Link to comment Share on other sites More sharing options...
Craig Carr Posted December 1, 2020 Share Posted December 1, 2020 Hi Dave, excellent stuff. I’ve sent you a PM Craig Quote Link to comment Share on other sites More sharing options...
Craig Carr Posted December 15, 2020 Share Posted December 15, 2020 Hi Dave, My display came today. Thanks very much for the sketch files you emailed across. I flashed it to the arduino and it fired up straight away. My phone camera doesnt do it justice (cant get rid of the glare) but looks exactly the same as yours. Is it possible to drive more than one screen from a single arduino to have the different cockpit displays running at once? Craig Quote Link to comment Share on other sites More sharing options...
FlyinFlynn Posted December 16, 2020 Share Posted December 16, 2020 Posted by Craig Carr on 15/12/2020 17:47:16: Is it possible to drive more than one screen from a single arduino to have the different cockpit displays running at once? Craig Already been asked and answered earlier in the thread. Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted December 16, 2020 Author Share Posted December 16, 2020 A few have asked if its possible to get the arduino to do 2 screens. Normally devices are activated with a CS or chip select signal. These displays have a CS signal but its not connected to the pins you can access. Its possible to hack them but thats not for the light hearted see **LINK** The other issue is both displays have to fit onto the aduino so the weather display i did cannot share another display due to the size of the weather bitmap used! However:- I have been playing and found out that two displays connected to the same set of pins will both display an image (comms only going one direction to the screen !) By adding a 4.7k resistor in circuit of one of the displays SDA lines (to pin 11 of the arduino), the display isnt affected. If i now connect another pin say pin 3 to the other end of the resistor (directly to the SDA of the display), i can effectively short it down to 0v stopping the display responding to further instructions. Using code like this, a second display can be written but the first screen continues to display the first display void setup(void) { pinMode(3, INPUT); // draw first image to both screens pinMode(3, OUTPUT); digitalWrite(3, LOW); // draw second image to only one screen } Initially, pin 3 is set to be an input eg is open circuit (so doesnt affect the drawing of both screens) after the first display is drawn, the pin is changed to be an output and set to 0v the second display only updates onto the second screen! Obviously, only the second display can do animation as the first one is fixed! This is a rough and ready way to achieve this (im sure there are more elegant ways!) Here is both the horizon and weather displays (less the .bmp to make it smaller) on one arduino! Quote Link to comment Share on other sites More sharing options...
Gary Manuel Posted December 16, 2020 Share Posted December 16, 2020 I like that Dave Quote Link to comment Share on other sites More sharing options...
Craig Carr Posted December 16, 2020 Share Posted December 16, 2020 Nice Dave Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted December 16, 2020 Author Share Posted December 16, 2020 Thanks guys Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted December 16, 2020 Author Share Posted December 16, 2020 Two displays used just over 50% of the memory 3 or even 4 display from one arduino???? Compiler output Sketch uses 16064 bytes (52%) of program storage space. Maximum is 30720 bytes. Global variables use 413 bytes (20%) of dynamic memory, leaving 1635 bytes for local variables. Maximum is 2048 bytes. Quote Link to comment Share on other sites More sharing options...
Mike Blandford Posted December 16, 2020 Share Posted December 16, 2020 For information the USART on an ATMEGA328 may also be used in SPI mode to provide two SPI interfaces (D4 is the clock). The main problem is I don't think there is any library code support for it, you would need to program it directly. Mike Quote Link to comment Share on other sites More sharing options...
dave windymiller Posted December 24, 2020 Author Share Posted December 24, 2020 Ive looked into the dual spi thanks Mike but at this stage its a bit deeper than i can manage with editing display library routines. Until recently, the last processors i played with were Z80 and 8088 chips some 30 yrs back - im a bit rusty!! The previous way to get 2 screens would appear to be Arduino type sensitive with at least one person who couldnt get it to work when a resistor was used in the D11 line. Ive tried a variety of approaches with no extra hardware but found them unreliable and screen type sensitive (having two different screens myself). Below is another method circuit diagram thats a bit more elegant and robust ! It needs a slight code change and a 74HC00 chip which is only some 50p! I personally think its easier to have one screen per arduino! Happy xmas folks ------------------ void setup(void) { pinMode(3, OUTPUT); digitalWrite(3, HIGH); // enable D11 to both screens // draw first image to both screens digitalWrite(3, LOW); // turns off D11 to one screen // draw second image to only one screen } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.