Shop OBEX P1 Docs P2 Docs Learn Events
Memory Map saids that it 95% FULL I was able to add a LCD Display (ReSolved) — Parallax Forums

Memory Map saids that it 95% FULL I was able to add a LCD Display (ReSolved)

sam_sam_samsam_sam_sam Posts: 2,286
edited 2008-07-25 04:18 in General Discussion
I have the routine the way that·I want it
·The memory map saids 95% FULL

Dose any one have any···· idea.gif·s

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·idea.gif·that you may have and all of your time finding them

·
·
·
·
Sam

Post Edited (sam_sam_sam) : 7/25/2008 4:26:25 AM GMT

Comments

  • ZootZoot Posts: 2,227
    edited 2008-07-25 01:54
    The core of your program is relatively compact. Two things I noticed however:

    - your long debug statements take a LOT of space -- I cut all the debug statements down (see attached) to a few characters and it freed up quite a bit of room. Debugs are hefty (every character is a byte less left for your program

    - the following code is basically repeated in every "code x" routine:
    DO
        GOSUB Get_Time
        IF hrs = 0 AND mins = $01 AND secs = $00 THEN EXIT
        DEBUG "b3"
        GOSUB LED_Light
    LOOP
    
    



    Since the debug "button 3" or whatever is based on the remote code, you could put the above in a subroutine, and call that new routine in place of every do loop -- would also save quite a bit of space (I left this for you to tackle). E.g....
    'subroutine, presumes remotecode is already set
    Blink_Rcode_Until_Next_Time:
       DO
          GOSUB Get_Time
          IF hrs = 0 AND mins = $01 AND secs = $00 THEN EXIT
          DEBUG "b", HEX2 remotecode
          GOSUB LED_Light
       LOOP
       RETURN
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-07-25 03:23
    Zoot

    Thank You for helping me clean this code up· · smile.gif·· · smile.gif· ·· smile.gif

    I for got how much memory the DEBUG Statement s take up

    I was able to add a· Two Line LCD Display to this project

    and still have only used 76% of the memory on Ver_2 and on

    Ver_3 it down too 72%


    Since the debug "button 3" or whatever is based on the remote code, you could put the above in a subroutine, and call that new routine in place of every do loop -- would also save quite a bit of space (I left this for you to tackle). E.g....

    These routine are not really the same I only had them the same to make sure that ALL of the Button Routine worked

    Also the code routine code_0 may not be right·

    code_0:
    ·· TOGGLE relay
    ·· TOGGLE led
    · GOSUB Get_IR
    ··· RETURN

    I have not try this yet to see if this will work

    What·I want to is is if you hit (0) on the remote on time it turn the relay ON

    When hit (0) on the remote on the second time it turn OFF the relay

    I·will try the power button to see what # it is and use it if I can

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 7/25/2008 12:20:55 PM GMT
  • ZootZoot Posts: 2,227
    edited 2008-07-25 03:57
    Even if the finals won't quite be the same, unless you need them, I would take out the debugs in the loops certainly (once you are convinced your remotecodes are received properly and you can trust that the code for that is correct).

    Is "relay" a pin to relay driver (i.e. a discrete transistor/diode driver for the coil or a driver like the ULN2803). If so, toggle should be fine. However, you might want to put some kind of delay in the code routine that toggles the relay, or account for a "repeat" press in your logic -- in other words, if the user keeps their finger on the 0 button, you don't want to keep toggling it back and forth rapidly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    1uffakind.com/robots/povBitMapBuilder.php
    1uffakind.com/robots/resistorLadder.php
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2008-07-25 04:18
    Zoot

    Yes I am using a ULN2803

    Is "relay" a pin to relay driver (i.e. a discrete transistor/diode driver for the coil or a driver like the ULN2803).· ·

    ·However, you might want to put some kind of delay in the code routine that toggles the relay, or account for a "repeat" press in your logic -- in other words, if the user keeps their finger on the 0 button, you don't want to keep toggling it back and forth rapidly.

    Thank You for all of your help

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
Sign In or Register to comment.