Creative ways to make macros with the least amount of code space


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default Re: Creative ways to make macros with the least amount of code space

    Maybe I didn't explain it right.

    Lets say you had a keypad with button 0 to 10. Each button press is read as a number under normal operation. Now put a big read button on the wall and allow that button to be custom programmed to be any button combination. So I could make that big red button on the wall bee 554422 or 541874, whatever I wanted. So you would put that button in to a "programming mode" and then on the keypad, type in the sequence you want, exit programming mode and now the big red button does that sequence every time you press it. It's like using a gaming keypad on a computer. You can record a macro or keystrokes that are replayed when pressing the button you chose to use to play the macro back (in our case the big red button).

    The only way I see to do this with little code space is getting creative with arrays but I have nearly zero experience with arrays.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Creative ways to make macros with the least amount of code space

    I'm a little weak with arrays too, but a keypad reader will require one. What you can do is have a subroutine with the master code and use the "big red button" control it. Mister_e did a keypad routine as an include, but you'll have to roll your own array to store the results.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333


    Did you find this post helpful? Yes | No

    Default Re: Creative ways to make macros with the least amount of code space

    Quote Originally Posted by plyrathrt View Post
    Maybe I didn't explain it right.

    Lets say you had a keypad with button 0 to 10. Each button press is read as a number under normal operation. Now put a big read button on the wall and allow that button to be custom programmed to be any button combination. So I could make that big red button on the wall bee 554422 or 541874, whatever I wanted. So you would put that button in to a "programming mode" and then on the keypad, type in the sequence you want, exit programming mode and now the big red button does that sequence every time you press it. It's like using a gaming keypad on a computer. You can record a macro or keystrokes that are replayed when pressing the button you chose to use to play the macro back (in our case the big red button).
    Sound easy enough to me.
    The only way I see to do this with little code space is getting creative with arrays but I have nearly zero experience with arrays.
    Looks like a good reason to learn. Let me know if you want me to help.

Similar Threads

  1. Working code but my layman approach uses too much code space
    By Christopher4187 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th December 2012, 20:44
  2. I'm running out of code space example.
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st June 2010, 20:33
  3. Ways to make code easily reviewable and extendable
    By Ted's in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 23rd August 2008, 00:10
  4. Need more code space
    By Sphere in forum General
    Replies: 2
    Last Post: - 19th September 2005, 20:49
  5. Need more code space
    By ghutchison in forum General
    Replies: 1
    Last Post: - 12th February 2005, 20:54

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