Graphical Displays with PBP3


+ Reply to Thread
Results 1 to 40 of 115

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,696


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    it appears there was a bug in drawing vertical lines. this now works
    Attached Files Attached Files
    Warning I'm not a teacher

  2. #2
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Excellent! Hats off again Richard. This looked like a lot of work in putting it all together. If we ever meet, the drinks will definitely be on me!

    Troy

  3. #3
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Richard,
    Another question: can we pass variables as parameters to these geometric routines?

    Like:

    DRAWLINE My_x1, My_y1, My_x2, My_y2, 1

    So far I'm trying to pass byte size variables but getting illegal opcode messages at compile?

    Troy

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,696


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    Another question: can we pass variables as parameters to these geometric routines?
    EASY , Just add the needed macro's to the include file, you can dial up whatever you like

    http://www.picbasic.co.uk/forum/show...hlight=ssd1306
    http://www.picbasic.co.uk/forum/show...hlight=usercmd
    http://support.melabs.com/forum/picb...er/usercommand
    Last edited by richard; - 3rd April 2021 at 14:03.
    Warning I'm not a teacher

  5. #5
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    EASY , Just add the needed macro's to the include file, you can dial up whatever you like
    oookay

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,696


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    DRAWLINE My_x1, My_y1, My_x2, My_y2, 1
    You need a macro like
    DRAWLINE?BBBBC
    the error message will tell you this does not exist

    the existing drawline macros
    Code:
    ;LINE 
    DRAWLINE?WWWW  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?WB    X0in ,_s_xstart
        MOVE?WB    X1in ,_s_xend
        MOVE?WB    Y0in ,_s_ystart
        MOVE?WB    Y1in ,_s_yend
        L?CALL _dline 
        endm  
    DRAWLINE?WWBW  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?WB    X0in ,_s_xstart 
        MOVE?BB    X1in ,_s_xend
        MOVE?WB    Y0in ,_s_ystart
        MOVE?WB    Y1in ,_s_yend
        L?CALL _dline 
        endm 
    DRAWLINE?WWBB  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?WB    X0in ,_s_xstart
        MOVE?BB    X1in ,_s_xend
        MOVE?WB    Y0in ,_s_ystart
        MOVE?BB    Y1in ,_s_yend
        L?CALL _dline 
        endm  
    DRAWLINE?WWCC  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?WB    X0in ,_s_xstart
        MOVE?CB    X1in ,_s_xend
        MOVE?WB    Y0in ,_s_ystart
        MOVE?CB    Y1in ,_s_yend
        L?CALL _dline 
        endm       
    DRAWLINE?WWWB  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?WB  X0in ,_s_xstart
        MOVE?WB  X1in ,_s_xend 
        MOVE?WB  Y0in ,_s_ystart
        MOVE?BB  Y1in ,_s_yend
        L?CALL _dline 
        endm        
    DRAWLINE?BBBB  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?BB     X0in ,_s_xstart
        MOVE?BB     X1in ,_s_xend
        MOVE?BB     Y0in ,_s_ystart
        MOVE?BB     Y1in ,_s_yend
        L?CALL _dline 
        endm  
    DRAWLINE?CCCC  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?CB  X0in ,_s_xstart
        MOVE?CB  X1in ,_s_xend
        MOVE?CB  Y0in ,_s_ystart
        MOVE?CB  Y1in ,_s_yend
        L?CALL   _dline 
      endm  
    DRAWLINE?CCCB  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?CB  X0in ,_s_xstart
        MOVE?CB  X1in ,_s_xend
        MOVE?CB  Y0in ,_s_ystart
        MOVE?BB  Y1in ,_s_yend
        L?CALL   _dline 
      endm  
    DRAWLINE?CCCW macro X0in ,Y0in ,X1in ,Y1in
        MOVE?CB  X0in ,_s_xstart
        MOVE?CB  X1in ,_s_xend
        MOVE?CB  Y0in ,_s_ystart
        MOVE?WB  Y1in ,_s_yend
        L?CALL   _dline 
      endm      
    DRAWLINE?BBCC  macro X0in ,Y0in ,X1in ,Y1in
        MOVE?BB  X0in ,_s_xstart
        MOVE?CB  X1in ,_s_xend
        MOVE?BB  Y0in ,_s_ystart
        MOVE?CB  Y1in ,_s_yend
        L?CALL _dline 
        endm 
    DRAWLINE?CCCCC  macro X0in ,Y0in ,X1in ,Y1in,Col
        MOVE?CB  Col ,_colour
        MOVE?CB  X0in ,_s_xstart
        MOVE?CB  X1in ,_s_xend
        MOVE?CB  Y0in ,_s_ystart
        MOVE?CB  Y1in ,_s_yend
        L?CALL   _dline 
      endm


    you could add this



    Code:
    DRAWLINE?BBBBC  macro X0in ,Y0in ,X1in ,Y1in,Col
        MOVE?BB     X0in ,_s_xstart
        MOVE?BB     X1in ,_s_xend
        MOVE?BB     Y0in ,_s_ystart
        MOVE?BB     Y1in ,_s_yend
        MOVE?CB     Col  ,_colour
        L?CALL _dline 
        endm

    or set the colour manually
    eg colour=1

    and use
    DRAWLINE My_x1, My_y1, My_x2, My_y2
    which already exists
    DRAWLINE?BBBB
    with a mono display you probably wont change the colour too often
    Warning I'm not a teacher

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,696


    Did you find this post helpful? Yes | No

    Default Re: Graphical Displays with PBP3

    a 5 input user command has the potential to need 5 raised to the 7th power of macros to cover every input permutation possible
    a ridiculous number, i only ever create what seems useful to me. it's trivially easy to add any other combination you app calls for
    and the compiler error virtually spells it out for you
    Warning I'm not a teacher

Similar Threads

  1. Replies: 3
    Last Post: - 1st January 2021, 22:28
  2. problem using Graphical LCD
    By Mostafa in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2007, 19:15
  3. Graphical LCDs
    By T.Jackson in forum General
    Replies: 5
    Last Post: - 14th May 2007, 07:29
  4. Vb 6.0 Graphical plug in
    By rocky79 in forum Serial
    Replies: 0
    Last Post: - 8th March 2006, 19:42
  5. Graphical user interface
    By rocky79 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th October 2005, 13:25

Members who have read this thread : 21

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts