DT Instant Interrupts


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by krohtech View Post
    Hi Skymask,
    Maybe I can clarify what I am trying to do. I didn’t post my entire code because it is very long. I will attach as a text file. I am designing a sign controller AKA sign animator AKA sign speller. What I need to do is CH1 ON pause X, add CH2 on Pause X, add CH3 pause X … This is an oversimplification but you can get the idea. It will allow me to program patterns left to right, right to left, center out, outside in, fade from left to right etc.
    I guess I was hoping for was some kind of nested for next loop with an array?
    I probably am not phrasing it correctly as I am a beginning programmer. Most of my experience is in programming large theatrical RGB lighting clusters which is not really programming in the same use of the word. I really haven’t “written code” since high school.
    I do appreciate all the help and am enjoying the journey!!!
    Where do you plan on storing all of this data? On chip eeprom, program memory, off chip serial eeprom, CF card?
    I can see using a FONT table to store all of the characters, each character being a mini-array of points. Then depending on how you read out those points from that array, it may look like the character is shifting left/right/up/down, whatever.

    I think you need to setup an array of data and do matrix operations on that array when dealing with the full screen.
    I.E.
    4 x 4 array = 16 data points, array var byte[16]
    x / y = 4 / 4 = 16
    point 0,0
    x + (y*4) = point in array, in this case point 0, first byte in array
    point 3,3
    x + (y*4) = point in array, in this case point 15, last byte in array
    PBP doesn't do multi-dimensional arrays but you can easily overcome that with some simple math.

  2. #2
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Thanks Skimask

    I will have to play with this to absorb it. I will give it a try this weekend.
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  3. #3
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    Where do you plan on storing all of this data? On chip eeprom, program memory, off chip serial eeprom, CF card?
    I was planning on storing the data in the program memory as it will probably not need to be changed once the sign is installed.
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default More Examples

    Quote Originally Posted by krohtech
    I guess I was hoping for was some kind of nested for next loop with an array?
    I don't know if I can explain the whole Arrays and Loops category. Would need a full book.

    But here's some more examples (untested) that might nurture some thoughts.
    Code:
    Value       VAR BYTE
    X           VAR BYTE
    Y           VAR BYTE
    MarqueeCnt  VAR BYTE
    RepeatCnt   VAR BYTE
    Rnd         VAR WORD : Rnd = 123
    
    MaxChannel  CON 15
    
    Main:
        Value = DIM
        GOSUB ALL2Value
        Pause 2000
        GOSUB Marquee
        GOSUB Scan
        GOSUB DoRandom
    GOTO Main
    
    ;------------------------
    Marquee:
        Value = 0
        Gosub ALL2value
        For RepeatCnt = 1 to 50
            MarqueeCnt = (MarqueeCnt + 1) // 4
            For X = 0 to MaxChannel STEP 4
                For Y = X to X + 3
                    Lookup ((Y-X) + MarqueeCnt),[0,25,75,25,0,25,75,25],Value
                    DutyVars(Y) = Value  
                Next Y
            Next X
        Next RepeatCnt
    Return
    
    
    ;------------------------
    Scan:
        Value = 0
        Gosub ALL2value
        For RepeatCnt = 1 to 20
            For X = 0 to MaxChannel 
                DutyVars(X) = MED
                Pause 200
                DutyVars(X) = 0
            Next X
        Next RepeatCnt
    Return
    
    
    ;------------------------
    DoRandom:
        For RepeatCnt = 1 to 100
            For X = 0 to MaxChannel 
                RANDOM Rnd
                DutyVars(X) = Rnd // 100
            Next X
            Pause 200 
        Next RepeatCnt
    Return
    
    ;------------------------
    ALL2value:
        For X = 0 to MaxChannel
            DutyVars(X) = Value
        Next X
    Return
    HTH,
    DT

  5. #5
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    I don't know if I can explain the whole Arrays and Loops category. Would need a full book.
    Can anyone recomend a good book on PBP or BASIC that may help with the finer points of arrays and loops etc. I am very willing to read and research to learn more.


    Thanks Darrel,

    I will have more time this weekend to try this.
    Last edited by krohtech; - 15th February 2008 at 04:01.
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by krohtech View Post
    Can anyone recomend a good book on PBP or BASIC that may help with the finer points of arrays and loops etc. I am very willing to read and reserarch to learn more.
    Thanks Darrel,
    I will have more time this weekend to try this.
    I don't think there really is such an animal as a book that would explain the finer points of loops/arrays, and such, and except for some oddball things about PBP variables (indexing and such), I'm kinda thinking that there aren't any finer points of loops and arrays.
    I think this is one of those cases when you have to play with the structure of the loops and arrays until you get it how you like it and can understand it the best, whether you pull the data from eeprom, or make it up on the spot or whatever.
    I think it boils down to your 'coding style' (many think my 'coding style' sucks for instance because I use too many colons).
    There are lots of good books on coding, I haven't read any of them (refer to the earlier statement about coding style).

Similar Threads

  1. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  2. DT Instant Interrupts help
    By perides in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 26th November 2008, 18:41
  3. 12F683 and DT Instant Interrupts
    By jderson in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 22nd November 2008, 12:47
  4. 18F1220 and DT Instant Interrupts
    By jderson in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th June 2008, 05:37
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

Members who have read this thread : 0

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