Jump to content

dave windymiller

Members
  • Posts

    421
  • Joined

  • Last visited

Everything posted by dave windymiller

  1. 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
  2. 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
  3. 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
  4. 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!!!
  5. 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
  6. The only smaller display i know about is 0.96" but more rectangular with 160 x 80 pixels (much lower res!). The best bet is to partially cover up the 1" 240x240 screen !   There is a 0.91" display but at 128 x 32 and mono colour (Blue or white!)   Edited By dave windymiller on 26/11/2020 20:12:35
  7. Hiya Nick. The displays use spi bus so it may possible to have multiple displays. Obviously the two display programs would have to fit into the arduino memory. Similarly, one display could display two images one after the other or switched memory permitting? For two displays I would have one arduino each and these could be connected by i2c bus to talk to each other if req. Lot of effort? Yes but interesting.
  8. Thanks flyinfynn. Like you say some say 3.3V some say 5V. I experimented today by powering an ardiuno nano (CH340 version) & display from a new 4.8v receiver pack and dropping the voltage using a couple of diodes. With one diode, 4.4V measured, the display and arduino fired up no problems and there was no noticeable brightness difference. With 2 diodes again it ran every time (3.7V measured) but you could see a slight dimming of the display. I think one diode would be a reasonable compromise and a simple thing to try if anyone is concerned about 5V! You could alternatively use the volts from one cell of a lipo via the balance lead? Anyhoo As you can see above the display has a bit more detail now added. To get the dashes i simply added black filled circles 3 pixel radius and manually moved them to get the right position by eyeball (initally coloured red to see them!). Start with the center one and work in one direction. Once one half is done, simply use 240 - (the first value) to get a matching spot on the opposite side! // 2nd ring LHS tft.fillCircle(38, 179, 3, BLACK); tft.fillCircle(44, 168, 3, BLACK); tft.fillCircle(52, 158, 3, BLACK); tft.fillCircle(60, 149, 3, BLACK); tft.fillCircle(70, 141, 3, BLACK); tft.fillCircle(81, 134, 3, BLACK); tft.fillCircle(93, 129, 3, BLACK); tft.fillCircle(105, 127, 3, BLACK); // middle tft.fillCircle(120, 125, 3, BLACK); // RH side same but values (for example)240-38 = 202 tft.fillCircle(202, 179, 3, BLACK); tft.fillCircle(196, 168, 3, BLACK); tft.fillCircle(188, 158, 3, BLACK); tft.fillCircle(180, 149, 3, BLACK); tft.fillCircle(170, 141, 3, BLACK); tft.fillCircle(159, 134, 3, BLACK); tft.fillCircle(147, 129, 3, BLACK); tft.fillCircle(135, 127, 3, BLACK); This is clearly non optimised/ crude programming (before anyone says!) but easy to do! Ideally you would use trig to calculate where these spots go and have a routine to do it. If i was making many of these i would invest the time to make a routine to create dashed lines more elegantly. It took me ~90mins to do all three lines! Im sure someone with more programming skill can do it "correctly" in less time? Thinking ahead, the weather will be drawn first (inserted prior to the code for the dashed lines) so the spots may show up on non black backgrounds so these can be changed to match the background as req! The tick marks on the outer ring are done similarly (trial and error for one half!). The text is manually placed eg // White text tft.setTextColor(WHITE); tft.setTextSize(1); tft.setCursor(5,0); tft.println("BS" ) ; tft.setCursor(60,0); tft.println("TAS" ) ; tft.setCursor(180,0); tft.println("BENIP" ) ; tft.setCursor(35,15) ; tft.println("/" ) ;   Notice how the text is horizontal not rotated as per original. Again it could be done with elegant software but not by me! Artistic license! Note the difference between size 1 and size 2 text!! Next is the weather. Not sure how best to do that yet with all those fuzzy edges! ps i will gladly share the full code via email on request! (not put it on here, too long. Dave   Edited By dave windymiller on 25/11/2020 21:20:46 Edited By dave windymiller on 25/11/2020 21:25:49
  9. Re 3.3 or 5V My original display was from here which stated 5V but further down the listing says "3.3-5V, (3.3V recommended)"!. Having since seen other identical displays stated as 3.3V i have found that running mine on 3.3V, it fails to start up reliably but is fine on 5V (powered by the usb lead). This being said all the data lines would be at 5V but powered from the 3.3V pin of the arduino which may confuse it?. Maybe it would be better (from a longivety point of view?) on a 3.3V arduino but I have been playing with my display over a year and still it works!  I have seen postings that use resistors networks to drop the data lines from 5 to 3.3 but that didnt seem necessary in my case having already used 5V? I read somewhere that the display has a voltage regulator on the back (u2 i presume). but cant say i delved any deeper.  Any info from others re this would be useful! I had no intentions of posting on the arduino forum, with it being very model plane orientated!   Edited By dave windymiller on 24/11/2020 20:33:02
  10. Wow indeed. He must have a big team and massive budget.
  11. See secrets of the mega factories on more4 now! Shows your balsa supplies disappearing! . Edited By dave windymiller on 23/11/2020 22:48:13
  12. To add the distance arcs, you draw circles centred on the yellow plane at 120, 215 // draw distance arcs tft.drawCircle(120, 215, 45, WHITE); tft.drawCircle(120, 215, 90, WHITE); tft.drawCircle(120, 215, 135, tft.color565(255, 255, 255)); tft.drawCircle(120, 215, 180, tft.color565(255, 255, 255)); Note the two different ways to specify a colour. you can use the 16 std colours or custom by varying the rgb values. The three 255 values are red green blue values. When all three are 255 (max) this adds up to white. 0,0,0 is black with 16million options between! To truncate the inner two circles ive added triangles (shown blue for clarity) When two are drawn as a mirror of each other:- //trim circles with black triangle tft.fillTriangle(0, 170, 0, 240, 150, 240, BLACK ); tft.fillTriangle(240, 170, 240, 240, 90, 240, BLACK ); You get Next to make the arcs dashed   Edited By dave windymiller on 21/11/2020 19:47:18
  13. I shall first draw the plane in yellow at the bottom of the screen with the below code #define TFT_DC 7 #define TFT_RST 8 #define SCR_WD 240 #define SCR_HT 240 #include <SPI.h> #include <Arduino_ST7789_Fast.h> Arduino_ST7789 tft = Arduino_ST7789(TFT_DC, TFT_RST); unsigned long res[16]; // initialisationrequired for the display void setup(void) { tft.init(SCR_WD, SCR_HT); tft.fillScreen(BLACK); // fills screen black tft.fillRoundRect(110, 210, 22, 2, 0, YELLOW); // draw yellow plane tft.fillRoundRect(120, 205, 2, 22, 0, YELLOW); tft.fillRoundRect(115, 222, 12, 2, 0, YELLOW); } void loop() { } // loop around endlessly having drawn screen Normally the main code is within the “loop” but I am doing it to run once in the “setup” section. Loop simply goes around in circles once the screens drawn! With a numbering system that has 0,0 as top left to 240,240 as bottom right, the wings are drawn using a rectangle tft.fillRoundRect(110, 210, 22, 2, 0, YELLOW); from 110 across, 210 down, 22 long (l to r) and 2 wide (downwards). 0 is the radius of the corners of the rectangle but 0 just gives sharp corners! Playing with the numbers will show the effect The fus and tail are similarly done. It takes a while to tweak the values to get the lines where you want them!! The display printed out on a 240x240 paper grid helps here! Next instalment when I get round to it ie when its too cold in the garage!
×
×
  • Create New...