No announcement yet.

Creating a ring meter using serial from Arduino host

  • Filter
  • Time
  • Show
Clear All
new posts

  • Creating a ring meter using serial from Arduino host

    I am hoping that someone can point me to, or provide, some sample code that will allow the programmatic creation of a ring meter using the Diablo serial commands on an Arduino uno.
    The screen I have is the Gen4-uLCD-35DCT-CLB.

  • #2

    Welcome to the forum,

    Would you be able to give me a bit more detail of the ring meter and how you intend the display so I can try to prepare an example for you.

    I found some images of a ring meter

    Click image for larger version  Name:	ringMeter2.jfif Views:	0 Size:	11.0 KB ID:	72708

    Click image for larger version  Name:	ringMeter.jfif Views:	0 Size:	12.6 KB ID:	72709

    Is it something similar to the above images ?

    Am I right in thinking you won't be using an SD card in your application ?

    Best regards



    • #3
      Thanks for the quick response Paul.
      Yes, that's exactly the type of thing I would like to create.

      I have looked at the code that creates the bottom gauge, but it is written for a different TFT library and I have had no success in tying to port it to the Diablo serial library.
      I am not opposed to using the uSD card, but I just thought it would be simpler without.
      The colour effects of the bottom gauge would be my first choice.

      Ultimately I would want 5 gauges in an X pattern on the screen, all of which will show tank fluid levels. 3 gauges need show full to empty and 2 from empty to full.
      The outputs from the analog senders are 0-5v, so easy to read with the Arduino.
      Monitoring the 5 tanks and displaying their levels is all that the Arduino will be doing.

      I should add that programming is definitely not my forte, but I do have some basic skills.

      If you could do a detailed "step by step" for creating this type of meter, I am sure that would make for an excellent Application Note.


      • #4
        Thanks for the extra information.

        I will have a go and make it detailed so it's easy to follow. Can you bear with me a short while and I will try to create it programmaticly first and we see if we like the result.

        Best regards



        • #5
          That sounds excellent Paul.
          As I said... if this works out nicely it would make an excellent addition to the Application Notes, as I am sure that many others would also like to be able to create gauges like this programmatically using the 4D screens.

          If it is of any use, there is example code of the bottom ring gauge (created by Bodmer) using the TFT_HX8357 library (Meter_ring_HX8357_1) and an Instructable @

          I definitely appreciate your assistance with this.


          • #6
            I did actually have success (finally) modifying the code that created the gauges shown above to work with the Diablo serial library.
            I was still interested in seeing your efforts Paul, but if I am honest, I have ruled this option out, as the primitives (triangles, rectangles etc. drawing programmatically) have a very average on screen quality.

            As you probably know, I have now moved to using animated GIFs, which produce much nicer on screen graphics, plus... they are much easier to update too! 😁


            • #7

              This would be a better way. I was trying to keep it so you didn't have to use the SD card but I just couldn't get the speed that way. The other option would have been to have a function that you could call but would mean an SD card so is probably best to use animated gauges from SD for a nicer look.

              Best regards