Menu

Simple glcd guage v1

2018-04-03
2018-04-08
  • stan cartwright

    stan cartwright - 2018-04-03

    I thought of making gauges or meter dials like nextion displays for pic avr with enough mem to include glcd and trig.
    This is first try.
    Hard to make a universal any rotation and angle range meter it seems so I'll post a few different ideas and video when I've sorted.
    Meters can be done without trig I know, just draw a line from a point x,y to varying x,y constant.
    This is more clock like.
    https://youtu.be/axHTYdH9WW8

     

    Last edit: stan cartwright 2018-04-03
  • kent_twt4

    kent_twt4 - 2018-04-03

    Very niceStan. I have not been keeping up all with glcd stuff.

     
    • Anobium

      Anobium - 2018-04-04

      @Stan. Nice..

      If you keep the syntax to just the published Great Cow Methods then this should be highly usable. So, do not use any commands that only exist for that specific GLCD display.

       
  • stan cartwright

    stan cartwright - 2018-04-03

    I never learned trig in school '70, not until '83 when I had to convert bbc micro bullseye to amstad 464.
    That's why it was iffy...moi :)
    I also learnt music notation in the process.
    I'm trying to remember now and think a few examples might be useful. I love examples to play with.
    This won't match a nextion which needs little resources to run but pics avr have lots of memory..some do.
    I'll do something fancy like peak reading,hold and fall for the learning experience.
    Posting on youtube gets interest in gcb.
    Anobium's scale..or map function, makes gauges much easier to implement. That was a pain before.

     
  • stan cartwright

    stan cartwright - 2018-04-08

    A general glcd method is tricky as I only got glcd_width,height to work with and might not want centred display. https://youtu.be/z_CZIEapRk4
    This is code to change to horizontal 180.

    ;needle vars         
    radius=168                                                                  
    xcentre=160                                                                  
    ycentre=120                                                                  
    oldval=180 ;centre                                                          
    newval=180 ;of gauge                                                        
    ;---- draw the gauge                                                        
    start_degrees=90:end_degrees=270                                           
    for arc_radius=204 to 210                                                   
      arc (start_degrees,end_degrees,arc_radius,xcentre,ycentre,ili9341_white)    
    ;arc(start_degrees,end_degrees,arc_radius,arc_centre_x,arc_centre_y,arc_colour)
    next arc_radius                                                              
    FilledCircle (xcentre,ycentre,9,ILI9341_CYAN)                               
    circle (xcentre,ycentre,8,ili9341_red)                                      
    ;                                                                           
    radius=168                                                      
    ;---- start of main program    
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.