Menu

circle in help

2022-05-10
2022-05-11
  • stan cartwright

    stan cartwright - 2022-05-10

    Demonstration program:

    ;Circle and filled circle commands on a graphic LCD.
    ;This uses the 2-place trigonometric routines found in the include file.
    
    ;Thomas Henry -- 4/17/2014
    
    ;----- Configuration
    
    #chip 16F88, 8              ;PIC16F88 running at 8 MHz
    #config mclr=off            ;reset handled internally
    
    #include <GLCD.h>
    #include <Trig2Places.h>
    
    ;----- Constants
    
    ;Pinout is shown for the LCM12864H-FSB-FBW
    ;graphical LCD available from Amazon.
    
    ;       +5V                 ;LCD pin 1
    ;       ground              ;LCD pin 2
    ;       Vo = wiper of pot   ;LCD pin 3
    #define GLCD_DB0 PORTB.0    ;LCD pin 4
    #define GLCD_DB1 PORTB.1    ;LCD pin 5
    #define GLCD_DB2 PORTB.2    ;LCD pin 6
    #define GLCD_DB3 PORTB.3    ;LCD pin 7
    #define GLCD_DB4 PORTB.4    ;LCD pin 8
    #define GLCD_DB5 PORTB.5    ;LCD pin 9
    #define GLCD_DB6 PORTB.6    ;LCD pin 10
    #define GLCD_DB7 PORTB.7    ;LCD pin 11
    #define GLCD_CS2 PORTA.0    ;LCD pin 12
    #define GLCD_CS1 PORTA.1    ;LCD pin 13
    #define GLCD_RESET PORTA.2  ;LCD pin 14
    #define GLCD_RW PORTA.3     ;LCD pin 15
    #define GLCD_RS PORTA.4     ;LCD pin 16
    #define GLCD_ENABLE PORTA.6 ;LCD pin 17
    ;       Vee = pot low side  ;LCD pin 18
    ;       backlight anode     ;LCD pin 19
    ;       backlight cathode   ;LCD pin 20
    
    #define GLCD_TYPE GLCD_TYPE_KS0108
    #define GLCD_WIDTH 128
    #define GLCD_HEIGHT 64
    
    ;----- Variables
    
    'None required.
    
    ;----- Program
    
    GLCDCLS
    
    circle(10,10,10)                  ;upper left
    circle(117,10,10)                 ;upper right
    filledcircle(63,31,10)            ;center
    circle(63,31,20)                  ;center
    filledcircle(10,53,10)            ;lower left
    filledcircle(117,53,10)           ;lower right
    

    Not really, the midpoint circle algorithm is an algorithm used to determine the points needed for rasterizing a circle. Bresenham's circle algorithm is derived from the midpoint circle algorithm

     
  • Anobium

    Anobium - 2022-05-11

    Oh yes. I guess that at some point I thought.. what is the point of all that complexity and I changed to simple the standard GLCD commands, but, the point is the use of TRIG...

    So, I have found the original post in the forum, corrected it, tested and update the the Help. https://github.com/GreatCowBASIC/Help/blob/main/source/trigonometrycircles.adoc

    Good spot - I also found that you mentioned this... a few times.. So, apologies for not changing in the past.

     
    • stan cartwright

      stan cartwright - 2022-05-11

      I just came across it looking in gcb help. Does a trig circle "looks nicer??"
      The current GLCD circle plots one quadrant and copies it to the other 3. I doubt the trig circle did that, just plotted the whole circle but haven't checked.
      I like the trig "fun"ctions but the "fun" takes me back to school days cos after, I never used trig until I used gcb.
      Just sin and cos can do dials and moving needle pointer like analogue dial... that's all I mentioned. I was trying to copy nextion displays but cheaper... and easier than using nextion gui ide.
      trig not used much but glad it's there. Who needs Pi ? :)

      I figured how to use gcb trig from using and got better at it. Looking at old files, I was rubbish at first but seemed to have progressed, I want to do the rotating line box my self.
      Started but didn't finish. Just move 8 points and join them. Is easy really with basic :) not

       

      Last edit: stan cartwright 2022-05-11

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.