Shop OBEX P1 Docs P2 Docs Learn Events
Recommendations please :-) — Parallax Forums

Recommendations please :-)

ArchiverArchiver Posts: 46,084
edited 2001-04-12 22:46 in General Discussion
Hello,

I was hoping to get recommendations on what hardware would satisfy
the needs of a beginner. I'm a complete newbie who knows nothing
about microcontrollers, and was hoping that someone could give me an
idea about where to start.

My immediate project only entails very simple control commands. The
idea is to somehow connect a microcontroller to 4 different leaf
switches, so I can close and open any of the 4 circuits in any of *14
different pre-programmed sequences*. Each sequence will have as many
as 66 total commands, and will be executed within approximately 2
minutes. I want to be able to "press a button" at anytime along a 5
hour time-line to activate any of those 14 command sequences with
timing accuracy between each individual command no worse than 1/60th
of a second(within that sequence).

The microcontroller will in effect be duplicating the exact timing of
the commands in each sequence.(Commands that I will like to manually
program into it via the four leaf switches I mentioned).

Am I asking too much?

Any advice would be greatly appreciated.

Thank you for your time

Thanks

Darren Harris
Staten Island, New York.

Searcher7@m...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 15:37
    Hello,

    I was hoping to get recommendations on what hardware would satisfy
    the needs of a beginner. I'm a complete newbie who knows nothing
    about microcontrollers, and was hoping that someone could give me an
    idea about where to start.

    My immediate project only entails very simple control commands. The
    idea is to somehow connect a microcontroller to 4 different leaf
    switches, so I can close and open any of the 4 circuits in any of *14
    different pre-programmed sequences*. Each sequence will have as many
    as 66 total commands, and will be executed within approximately 2
    minutes. I want to be able to "press a button" at anytime along a 5
    hour time-line to activate any of those 14 command sequences with
    timing accuracy between each individual command no worse than 1/60th
    of a second(within that sequence).

    The microcontroller will in effect be duplicating the exact timing of
    the commands in each sequence.(Commands that I will like to manually
    program into it via the four leaf switches I mentioned).

    Any advice would be greatly appreciated.

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 16:06
    > Darren:

    Hardware selection depends upon what type of loads you are switching, and
    exactly what you mean in the timing you describe. Some timing requirements
    may create difficulties with a Basic Stamp, they're not super-fast, and RT
    requires additional hardware. If what you described means that it would be
    acceptable if the sequence of switch actions occur within 16 mS of each
    other in sequence, this can be done. Your 5 hour time line is not clear and
    may also be a problem.

    What exactly are you trying to build? Without more details or a more
    specific question, you might wind up re-posting this 100 times w/o getting
    the help you want...

    Chris


    >
    > Hello,
    >
    > I was hoping to get recommendations on what hardware would satisfy
    > the needs of a beginner. I'm a complete newbie who knows nothing
    > about microcontrollers, and was hoping that someone could give me an
    > idea about where to start.
    >
    > My immediate project only entails very simple control commands. The
    > idea is to somehow connect a microcontroller to 4 different leaf
    > switches, so I can close and open any of the 4 circuits in any of *14
    > different pre-programmed sequences*. Each sequence will have as many
    > as 66 total commands, and will be executed within approximately 2
    > minutes. I want to be able to "press a button" at anytime along a 5
    > hour time-line to activate any of those 14 command sequences with
    > timing accuracy between each individual command no worse than 1/60th
    > of a second(within that sequence).
    >
    > The microcontroller will in effect be duplicating the exact timing of
    > the commands in each sequence.(Commands that I will like to manually
    > program into it via the four leaf switches I mentioned).
    >
    > Any advice would be greatly appreciated.
    >
    > Thanks
    >
    > Darren Harris
    > Staten Island, New York.
    >
    > Searcher7@m...
    >
    >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 16:58
    "Hardware selection depends upon what type of loads
    you are switching,
    and exactly what you mean in the timing you describe."


    The loads are not at present an issue. After I figure
    out what electronic components(microcontroller) to
    get, I will have to figure out a way to interface it
    to the leaf switches I mentioned. The only "input"
    criteria for the microcontroller would be to accept
    any of 8 possible commands it will receive when I
    manually close and open any of four circuits. The more
    difficult part would be the output of any of those 8
    commands, since these circuits(leaf switches) have to
    by physically closed in order for the PCB on the other
    end to notice, I'd have to come up with a way to send
    a strong enough current through the wires to fool
    it.(I'm actually going to be using the 4-way joystick
    controls of an arcade game).

    I don't understand your question about the timing. If
    I were to "open", let's say switch "B" exactly 1.2
    seconds after I closed it, I want to microcontroller
    to output the same(to an accuracy of no worse than
    1/60th of a second) when I give it the command to do
    so. Actually, the longest of the 14 sequences will be
    112 different commands in about a two minute
    period.(And only 1 of the 4 circuits can actually be
    "closed" at one time).

    "Some timing requirements may create difficulties with
    a Basic Stamp, they're not super-fast, and RT requires
    additional hardware."

    That is why I'm trying to find out what I'd need to
    accomplish what I want.(And what is "RT"?).

    "If what you described means that it would be
    acceptable if the sequence of switch actions occur
    within 16 mS of each other in sequence, this can be
    done. Your 5 hour time line is not clear and may also
    be a problem."

    Then forget I mentioned the 5 hour time line. :-)

    "What exactly are you trying to build? Without more
    details or a more
    specific question, you might wind up re-posting this
    100 times w/o
    getting the help you want..."

    I honestly don't know what I haven't covered, or how
    to explain anything more clear than I already have. It
    is a very simple project.

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...




    ********************************************************************************\
    ********************************************************************************\
    *****
    --- "Chris Loiacono (E-mail)"
    <chris01@t...> wrote:
    >
    > > Darren:
    >
    > Hardware selection depends upon what type of loads
    > you are switching, and
    > exactly what you mean in the timing you describe.
    > Some timing requirements
    > may create difficulties with a Basic Stamp, they're
    > not super-fast, and RT
    > requires additional hardware. If what you described
    > means that it would be
    > acceptable if the sequence of switch actions occur
    > within 16 mS of each
    > other in sequence, this can be done. Your 5 hour
    > time line is not clear and
    > may also be a problem.
    >
    > What exactly are you trying to build? Without more
    > details or a more
    > specific question, you might wind up re-posting this
    > 100 times w/o getting
    > the help you want...
    >
    > Chris
    >
    >
    > >
    > > Hello,
    > >
    > > I was hoping to get recommendations on what
    > hardware would satisfy
    > > the needs of a beginner. I'm a complete newbie who
    > knows nothing
    > > about microcontrollers, and was hoping that
    > someone could give me an
    > > idea about where to start.
    > >
    > > My immediate project only entails very simple
    > control commands. The
    > > idea is to somehow connect a microcontroller to 4
    > different leaf
    > > switches, so I can close and open any of the 4
    > circuits in any of *14
    > > different pre-programmed sequences*. Each sequence
    > will have as many
    > > as 66 total commands, and will be executed within
    > approximately 2
    > > minutes. I want to be able to "press a button" at
    > anytime along a 5
    > > hour time-line to activate any of those 14 command
    > sequences with
    > > timing accuracy between each individual command no
    > worse than 1/60th
    > > of a second(within that sequence).
    > >
    > > The microcontroller will in effect be duplicating
    > the exact timing of
    > > the commands in each sequence.(Commands that I
    > will like to manually
    > > program into it via the four leaf switches I
    > mentioned).
    > >
    > > Any advice would be greatly appreciated.
    > >
    > > Thanks
    > >
    > > Darren Harris
    > > Staten Island, New York.
    > >
    > > Searcher7@m...
    > >
    > >
    > >
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 17:26
    The Basic Stamp 2 will do this as long as you realize that there are no
    interrupts. This implies that you will need to loop through the 4 inputs
    continuously and check their state. As long as the program doesn't take more
    than 16mS to loop, which is a long time- even for a stamp, you should be OK.
    The 'button' instruction will help you 'debounce' your manual switches.
    If the toughest loop is 112 commands in 2 minutes or less, you're talking
    more than 1 second per, so it also is not too fast. More effort will go into
    making it take 2 minutes, if that's what you need. Just realize that again,
    while the 112 instructions are executing in their own loop, the only thing
    the stamp can do is wait for the loop to execute, or be reset.

    If I were you, I'd read the manual and 'stamps in class' downloads at
    www.parallaxinc.com


    CL

    >
    Original Message
    > From: Darren Harris [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=anHd1JeNiA_zh2b4Vpqne8Ivd0rDc0D18cPa5IWKHwQO6zEIEGLkfKu0w9_7Q35XtFyZHzdOyCwtUfY]searcher731@y...[/url
    > Sent: Thursday, April 12, 2001 11:58 AM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please :-)
    >
    >
    > "Hardware selection depends upon what type of loads
    > you are switching,
    > and exactly what you mean in the timing you describe."
    >
    >
    > The loads are not at present an issue. After I figure
    > out what electronic components(microcontroller) to
    > get, I will have to figure out a way to interface it
    > to the leaf switches I mentioned. The only "input"
    > criteria for the microcontroller would be to accept
    > any of 8 possible commands it will receive when I
    > manually close and open any of four circuits. The more
    > difficult part would be the output of any of those 8
    > commands, since these circuits(leaf switches) have to
    > by physically closed in order for the PCB on the other
    > end to notice, I'd have to come up with a way to send
    > a strong enough current through the wires to fool
    > it.(I'm actually going to be using the 4-way joystick
    > controls of an arcade game).
    >
    > I don't understand your question about the timing. If
    > I were to "open", let's say switch "B" exactly 1.2
    > seconds after I closed it, I want to microcontroller
    > to output the same(to an accuracy of no worse than
    > 1/60th of a second) when I give it the command to do
    > so. Actually, the longest of the 14 sequences will be
    > 112 different commands in about a two minute
    > period.(And only 1 of the 4 circuits can actually be
    > "closed" at one time).
    >
    > "Some timing requirements may create difficulties with
    > a Basic Stamp, they're not super-fast, and RT requires
    > additional hardware."
    >
    > That is why I'm trying to find out what I'd need to
    > accomplish what I want.(And what is "RT"?).
    >
    > "If what you described means that it would be
    > acceptable if the sequence of switch actions occur
    > within 16 mS of each other in sequence, this can be
    > done. Your 5 hour time line is not clear and may also
    > be a problem."
    >
    > Then forget I mentioned the 5 hour time line. :-)
    >
    > "What exactly are you trying to build? Without more
    > details or a more
    > specific question, you might wind up re-posting this
    > 100 times w/o
    > getting the help you want..."
    >
    > I honestly don't know what I haven't covered, or how
    > to explain anything more clear than I already have. It
    > is a very simple project.
    >
    > Thanks
    >
    > Darren Harris
    > Staten Island, New York.
    >
    > Searcher7@m...
    >
    >
    >
    >
    > **************************************************************
    > **************************************************************
    > *****************************************
    > --- "Chris Loiacono (E-mail)"
    > <chris01@t...> wrote:
    > >
    > > > Darren:
    > >
    > > Hardware selection depends upon what type of loads
    > > you are switching, and
    > > exactly what you mean in the timing you describe.
    > > Some timing requirements
    > > may create difficulties with a Basic Stamp, they're
    > > not super-fast, and RT
    > > requires additional hardware. If what you described
    > > means that it would be
    > > acceptable if the sequence of switch actions occur
    > > within 16 mS of each
    > > other in sequence, this can be done. Your 5 hour
    > > time line is not clear and
    > > may also be a problem.
    > >
    > > What exactly are you trying to build? Without more
    > > details or a more
    > > specific question, you might wind up re-posting this
    > > 100 times w/o getting
    > > the help you want...
    > >
    > > Chris
    > >
    > >
    > > >
    > > > Hello,
    > > >
    > > > I was hoping to get recommendations on what
    > > hardware would satisfy
    > > > the needs of a beginner. I'm a complete newbie who
    > > knows nothing
    > > > about microcontrollers, and was hoping that
    > > someone could give me an
    > > > idea about where to start.
    > > >
    > > > My immediate project only entails very simple
    > > control commands. The
    > > > idea is to somehow connect a microcontroller to 4
    > > different leaf
    > > > switches, so I can close and open any of the 4
    > > circuits in any of *14
    > > > different pre-programmed sequences*. Each sequence
    > > will have as many
    > > > as 66 total commands, and will be executed within
    > > approximately 2
    > > > minutes. I want to be able to "press a button" at
    > > anytime along a 5
    > > > hour time-line to activate any of those 14 command
    > > sequences with
    > > > timing accuracy between each individual command no
    > > worse than 1/60th
    > > > of a second(within that sequence).
    > > >
    > > > The microcontroller will in effect be duplicating
    > > the exact timing of
    > > > the commands in each sequence.(Commands that I
    > > will like to manually
    > > > program into it via the four leaf switches I
    > > mentioned).
    > > >
    > > > Any advice would be greatly appreciated.
    > > >
    > > > Thanks
    > > >
    > > > Darren Harris
    > > > Staten Island, New York.
    > > >
    > > > Searcher7@m...
    > > >
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > >
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Get email at your own domain with Yahoo! Mail.
    > http://personal.mail.yahoo.com/
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 18:17
    "The Basic Stamp 2 will do this as long as you realize
    that there are no
    interrupts. This implies that you will need to loop
    through the 4 inputs
    continuously and check their state."

    Providing I understand you correctly, is this a manual
    process or will the Basic Stamp do this?

    "As long as the program doesn't take more than 16mS to
    loop, which is a long time- even for a stamp, you
    should be OK."

    "The 'button' instruction will help you 'debounce'
    your manual switches."

    This is all Greek to me.

    "If the toughest loop is 112 commands in 2 minutes or
    less, you're talking more than 1 second per, so it
    also is not too fast. More effort will go into making
    it take 2 minutes, if that's what you need."

    It is not the length of time. I just said that a
    sequence may take about 2 minutes.

    "Just realize that again, while the 112 instructions
    are executing in their own loop, the only thing the
    stamp can do is wait for the loop to execute, or be
    reset."

    I assume that this means that it will follow the
    sequence I initiate to it's end, or I can manually
    reset, and start it(or another sequence) over?

    "If I were you, I'd read the manual and 'stamps in
    class' downloads at www.parallaxinc.com"

    I don't understand much of what you said, but I will
    check out the manual you mentioned.

    Nevertheless, here is just one more clarification of
    the basics of what I'm attempting...

    ***Years ago there was a multiplayer "family" game
    advertised on T.V. It entailed a device that would
    flash lights in a certain sequence. The player would
    then have to remember and duplicate that sequence by
    pressing the corresponding lighted buttons. The
    farther you got into the game the longer the sequence
    of lights you had to duplicate.(The more difficult it
    became).

    Now if you can imagine the computer in the human's
    place, and vice-versa, you will understand bacically
    what I'm attempting to accomplish. I will be using a
    4-way joystick to "input" 14 separate sequences
    containing many "on" and "off" commands to all 4
    connections.(As I said, each sequence will last a
    maximum of about 2 minutes, and have a total of 112
    commands). Now, when I press one of 14 buttons, it is
    the microcontroller that will have to duplicate the
    corresponding sequence to within 1/60th of a
    second(between each and every command in that
    sequence). So for example, if I'm using it on a game
    like Pacman, the microcontroller will be able to
    "repeat" any of my patterns, because I would allow it
    "read" and remember my joystick movements. It will
    then "output" any of the 14 programmed patterns when I
    press the corresponding button.

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    ********************************************************************************\
    ********************************************************************************\
    *****
    --- "Chris Loiacono (E-mail)"
    <chris01@t...> wrote:
    > The Basic Stamp 2 will do this as long as you
    > realize that there are no
    > interrupts. This implies that you will need to loop
    > through the 4 inputs
    > continuously and check their state. As long as the
    > program doesn't take more
    > than 16mS to loop, which is a long time- even for a
    > stamp, you should be OK.
    > The 'button' instruction will help you 'debounce'
    > your manual switches.
    > If the toughest loop is 112 commands in 2 minutes or
    > less, you're talking
    > more than 1 second per, so it also is not too fast.
    > More effort will go into
    > making it take 2 minutes, if that's what you need.
    > Just realize that again,
    > while the 112 instructions are executing in their
    > own loop, the only thing
    > the stamp can do is wait for the loop to execute, or
    > be reset.
    >
    > If I were you, I'd read the manual and 'stamps in
    > class' downloads at
    > www.parallaxinc.com
    >
    >
    > CL
    >
    > >
    Original Message
    > > From: Darren Harris [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=f1OWD_l6vjw49Z_5ekrQEx7WjDwH5vH3aKFVccyCY0FZ1YVBgYeFSPcYXSmtjMYFGuFxHL0gu1lDr_qN5A]searcher731@y...[/url
    > > Sent: Thursday, April 12, 2001 11:58 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please
    > :-)
    > >
    > >
    > > "Hardware selection depends upon what type of
    > loads
    > > you are switching,
    > > and exactly what you mean in the timing you
    > describe."
    > >
    > >
    > > The loads are not at present an issue. After I
    > figure
    > > out what electronic components(microcontroller) to
    > > get, I will have to figure out a way to interface
    > it
    > > to the leaf switches I mentioned. The only "input"
    > > criteria for the microcontroller would be to
    > accept
    > > any of 8 possible commands it will receive when I
    > > manually close and open any of four circuits. The
    > more
    > > difficult part would be the output of any of those
    > 8
    > > commands, since these circuits(leaf switches) have
    > to
    > > by physically closed in order for the PCB on the
    > other
    > > end to notice, I'd have to come up with a way to
    > send
    > > a strong enough current through the wires to fool
    > > it.(I'm actually going to be using the 4-way
    > joystick
    > > controls of an arcade game).
    > >
    > > I don't understand your question about the timing.
    > If
    > > I were to "open", let's say switch "B" exactly 1.2
    > > seconds after I closed it, I want to
    > microcontroller
    > > to output the same(to an accuracy of no worse than
    > > 1/60th of a second) when I give it the command to
    > do
    > > so. Actually, the longest of the 14 sequences will
    > be
    > > 112 different commands in about a two minute
    > > period.(And only 1 of the 4 circuits can actually
    > be
    > > "closed" at one time).
    > >
    > > "Some timing requirements may create difficulties
    > with
    > > a Basic Stamp, they're not super-fast, and RT
    > requires
    > > additional hardware."
    > >
    > > That is why I'm trying to find out what I'd need
    > to
    > > accomplish what I want.(And what is "RT"?).
    > >
    > > "If what you described means that it would be
    > > acceptable if the sequence of switch actions occur
    > > within 16 mS of each other in sequence, this can
    > be
    > > done. Your 5 hour time line is not clear and may
    > also
    > > be a problem."
    > >
    > > Then forget I mentioned the 5 hour time line. :-)
    > >
    > > "What exactly are you trying to build? Without
    > more
    > > details or a more
    > > specific question, you might wind up re-posting
    > this
    > > 100 times w/o
    > > getting the help you want..."
    > >
    > > I honestly don't know what I haven't covered, or
    > how
    > > to explain anything more clear than I already
    > have. It
    > > is a very simple project.
    > >
    > > Thanks
    > >
    > > Darren Harris
    > > Staten Island, New York.
    > >
    > > Searcher7@m...
    > >
    > >
    > >
    > >
    > >
    >
    **************************************************************
    > >
    >
    **************************************************************
    > > *****************************************
    > > --- "Chris Loiacono (E-mail)"
    > > <chris01@t...> wrote:
    > > >
    > > > > Darren:
    > > >
    > > > Hardware selection depends upon what type of
    > loads
    > > > you are switching, and
    > > > exactly what you mean in the timing you
    > describe.
    > > > Some timing requirements
    > > > may create difficulties with a Basic Stamp,
    > they're
    > > > not super-fast, and RT
    > > > requires additional hardware. If what you
    > described
    > > > means that it would be
    > > > acceptable if the sequence of switch actions
    > occur
    > > > within 16 mS of each
    > > > other in sequence, this can be done. Your 5 hour
    > > > time line is not clear and
    > > > may also be a problem.
    > > >
    > > > What exactly are you trying to build? Without
    > more
    > > > details or a more
    > > > specific question, you might wind up re-posting
    > this
    > > > 100 times w/o getting
    > > > the help you want...
    > > >
    > > > Chris
    > > >
    > > >
    > > > >
    > > > > Hello,
    > > > >
    > > > > I was hoping to get recommendations on what
    > > > hardware would satisfy
    > > > > the needs of a beginner. I'm a complete newbie
    > who
    > > > knows nothing
    > > > > about microcontrollers, and was hoping that
    > > > someone could give me an
    > > > > idea about where to start.
    > > > >
    > > > > My immediate project only entails very simple
    > > > control commands. The
    > > > > idea is to somehow connect a microcontroller
    > to 4
    > > > different leaf
    > > > > switches, so I can close and open any of the 4
    > > > circuits in any of *14
    > > > > different pre-programmed sequences*. Each
    > sequence
    > > > will have as many
    > > > > as 66 total commands, and will be executed
    > within
    > > > approximately 2
    > > > > minutes. I want to be able to "press a button"
    > at
    > > > anytime along a 5
    > > > > hour time-line to activate any of those 14
    > command
    > > > sequences with
    > > > > timing accuracy between each individual
    > command no
    > > > worse than 1/60th
    > > > > of a second(within that sequence).
    >
    === message truncated ===


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 19:03
    RE: [noparse][[/noparse]basicstamps] Recommendations please :-)

    So basically you want to 'Record' the movement of the joystick for later playback.· In order to do this, you will have to have two 'modes', a record mode and a playback mode. This would have to be switchable via a switch, or maybe a pushbutton that would initiate a 'record' sequence.· Then you will also need a way of choosing which sequence you want to play back, and this could be as simple as a number of pushbutton switches.

    You would have two sections to the program that ran on the stamp.

    The first would be the recorder and it would be initiated by the record button.· You would then move the joystick around and the stamp would scan the joystick switches on the joystick as quickly as it could and store the state of the switches into some sort of a storage device. This portion contains a potential problem, because each sample will have to be stored for later playback and you could potentially have a large amount of storage required.· If you are sampling at 1/60 of a second, you will have 4 bits of data for every 1/60 of a second which comes out to 30 bytes per second or 1.8K per minute. That means that each 2 minute sequence will require 1.8K of storage.· This will exceed the internal storage ability of the stamp and will require an external storage device.· There may also be problems storing this data fast enough to get it saved and then be ready to scan the joystick switches again within the 1/60 of a second time frame.· The record process could be terminated by pressing one of the buttons that are used for playback. Once this button press was complete the sequence could be assigned to that button for playback.

    The playback portion would wait for a button press and when a button was pressed, it would retrieve the data from the external storage device and configure it's pins for outputs.· It would then run through a loop and every 1/60 of a second it would retrieve and 'playback' the stored sample for that time period.

    Basically what you are trying to make is a 4 bit digital recorder.·

    Someone mentioned 'debouncing'. This refers to the fact that a switch doesn't make a clean on/off transistion.· It arcs and springs and makes dozens of contacts for each press of the switch.· The stamp is fast enough that it can detect these millisecond long contacts.· One switch press could be detected as 10 or 20 or more presses because of this effect.· I wouldn't worry about this though. What you are trying to do is record the actual movement of the switches on the joystick. The video game that you are playing back into expects the signals to be noisy and will be able to handle it.

    Your main problems are going to be timing and storage.· Getting the playback to happen at the same speed as the recording will be difficult.· You will have to do some research and find out how long each instruction takes and make sure that your playback and record loops have the EXACT same execution times.

    Interupts were also mentioned.· What this means is that there are two methods of letting a microcontroller know that something has happened that needs it's attention.· With the basic stamp the only way that really exists is for the stamp to be in a loop (a section of code that executes over and over) and just keep looking at an input over and over again until it gets pressed and then it knows it needs to do something.· Other Microcontrollers support interupts which are a special input to the microcontroller that will 'interupt' what the processor is doing and FORCE it to execute a section of code when the input happens.· This way the processor doesn't have to worry about whether or not any inputs have been pressed until it is interupted and then has to deal with it.· This is not an option on the stamp.

    --Scott



    Original Message

    From: Darren Harris [noparse]/noparse][url=mailto:searcher731@yahoo.com]mailto:searcher731@yahoo.com[/url
    Sent: Thursday, April 12, 2001 10:18 AM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please :-)


    "The Basic Stamp 2 will do this as long as you realize
    that there are no
    interrupts. This implies that you will need to loop
    through the 4 inputs
    continuously and check their state."

    Providing I understand you correctly, is this a manual
    process or will the Basic Stamp do this?

    "As long as the program doesn't take more than 16mS to
    loop, which is a long time- even for a stamp, you
    should be OK."

    "The 'button' instruction will help you 'debounce'
    your manual switches."

    This is all Greek to me.

    "If the toughest loop is 112 commands in 2 minutes or
    less, you're talking more than 1 second per, so it
    also is not too fast. More effort will go into making
    it take 2 minutes, if that's what you need."

    It is not the length of time. I just said that a
    sequence may take about 2 minutes.

    "Just realize that again, while the 112 instructions
    are executing in their own loop, the only thing the
    stamp can do is wait for the loop to execute, or be
    reset."

    I assume that this means that it will follow the
    sequence I initiate to it's end, or I can manually
    reset, and start it(or another sequence) over?

    "If I were you, I'd read the manual and 'stamps in
    class' downloads at www.parallaxinc.com"

    I don't understand much of what you said, but I will
    check out the manual you mentioned.

    Nevertheless, here is just one more clarification of
    the basics of what I'm attempting...

    ***Years ago there was a multiplayer "family" game
    advertised on T.V. It entailed a device that would
    flash lights in a certain sequence. The player would
    then have to remember and duplicate that sequence by
    pressing the corresponding lighted buttons. The
    farther you got into the game the longer the sequence
    of lights you had to duplicate.(The more difficult it
    became).

    Now if you can imagine the computer in the human's
    place, and vice-versa, you will understand bacically
    what I'm attempting to accomplish. I will be using a
    4-way joystick to "input" 14 separate sequences
    containing many "on" and "off" commands to all 4
    connections.(As I said, each sequence will last a
    maximum of about 2 minutes, and have a total of 112
    commands). Now, when I press one of 14 buttons, it is
    the microcontroller that will have to duplicate the
    corresponding sequence to within 1/60th of a
    second(between each and every command in that
    sequence). So for example, if I'm using it on a game
    like Pacman, the microcontroller will be able to
    "repeat" any of my patterns, because I would allow it
    "read" and remember my joystick movements. It will
    then "output" any of the 14 programmed patterns when I
    press the corresponding button.

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@mail.con2.com
    *********************************************************************************************************************************************************************

    --- "Chris Loiacono (E-mail)"
    <chris01@tampabay.rr.com> wrote:
    > The Basic Stamp 2 will do this as long as you
    > realize that there are no
    > interrupts. This implies that you will need to loop
    > through the 4 inputs
    > continuously and check their state. As long as the
    > program doesn't take more
    > than 16mS to loop, which is a long time- even for a
    > stamp, you should be OK.
    > The 'button' instruction will help you 'debounce'
    > your manual switches.
    > If the toughest loop is 112 commands in 2 minutes or
    > less, you're talking
    > more than 1 second per, so it also is not too fast.
    > More effort will go into
    > making it take 2 minutes, if that's what you need.
    > Just realize that again,
    > while the 112 instructions are executing in their
    > own loop, the only thing
    > the stamp can do is wait for the loop to execute, or
    > be reset.
    >
    > If I were you, I'd read the manual and 'stamps in
    > class' downloads at
    > www.parallaxinc.com
    >
    >
    > CL
    >
    > >
    Original Message

    > > From: Darren Harris [noparse]/noparse][url=mailto:searcher731@yahoo.com]mailto:searcher731@yahoo.com[/url
    > > Sent: Thursday, April 12, 2001 11:58 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please
    > :-)
    > >
    > >
    > > "Hardware selection depends upon what type of
    > loads
    > > you are switching,
    > > and exactly what you mean in the timing you
    > describe."
    > >
    > >
    > > The loads are not at present an issue. After I
    > figure
    > > out what electronic components(microcontroller) to
    > > get, I will have to figure out a way to interface
    > it
    > > to the leaf switches I mentioned. The only "input"
    > > criteria for the microcontroller would be to
    > accept
    > > any of 8 possible commands it will receive when I
    > > manually close and open any of four circuits. The
    > more
    > > difficult part would be the output of any of those
    > 8
    > > commands, since these circuits(leaf switches) have
    > to
    > > by physically closed in order for the PCB on the
    > other
    > > end to notice, I'd have to come up with a way to
    > send
    > > a strong enough current through the wires to fool
    > > it.(I'm actually going to be using the 4-way
    > joystick
    > > controls of an arcade game).
    > >
    > > I don't understand your question about the timing.
    > If
    > > I were to "open", let's say switch "B" exactly 1.2
    > > seconds after I closed it, I want to
    > microcontroller
    > > to output the same(to an accuracy of no worse than
    > > 1/60th of a second) when I give it the command to
    > do
    > > so. Actually, the longest of the 14 sequences will
    > be
    > > 112 different commands in about a two minute
    > > period.(And only 1 of the 4 circuits can actually
    > be
    > > "closed" at one time).
    > >
    > > "Some timing requirements may create difficulties
    > with
    > > a Basic Stamp, they're not super-fast, and RT
    > requires
    > > additional hardware."
    > >
    > > That is why I'm trying to find out what I'd need
    > to
    > > accomplish what I want.(And what is "RT"?).
    > >
    > > "If what you described means that it would be
    > > acceptable if the sequence of switch actions occur
    > > within 16 mS of each other in sequence, this can
    > be
    > > done. Your 5 hour time line is not clear and may
    > also
    > > be a problem."
    > >
    > > Then forget I mentioned the 5 hour time line. :-)
    > >
    > > "What exactly are you trying to build? Without
    > more
    > > details or a more
    > > specific question, you might wind up re-posting
    > this
    > > 100 times w/o
    > > getting the help you want..."
    > >
    > > I honestly don't know what I haven't covered, or
    > how
    > > to explain anything more clear than I already
    > have. It
    > > is a very simple project.
    > >
    > > Thanks
    > >
    > > Darren Harris
    > > Staten Island, New York.
    > >
    > > Searcher7@mail.con2.com
    > >
    > >
    > >
    > >
    > >
    >
    **************************************************************
    > >
    >
    **************************************************************
    > > *****************************************
    > > --- "Chris Loiacono (E-mail)"
    > > <chris01@tampabay.rr.com> wrote:
    > > >
    > > > > Darren:
    > > >
    > > > Hardware selection depends upon what type of
    > loads
    > > > you are switching, and
    > > > exactly what you mean in the timing you
    > describe.
    > > > Some timing requirements
    > > > may create difficulties with a Basic Stamp,
    > they're
    > > > not super-fast, and RT
    > > > requires additional hardware. If what you
    > described
    > > > means that it would be
    > > > acceptable if the sequence of switch actions
    > occur
    > > > within 16 mS of each
    > > > other in sequence, this can be done. Your 5 hour
    > > > time line is not clear and
    > > > may also be a problem.
    > > >
    > > > What exactly are you trying to build? Without
    > more
    > > > details or a more
    > > > specific question, you might wind up re-posting
    > this
    > > > 100 times w/o getting
    > > > the help you want...
    > > >
    > > > Chris
    > > >
    > > >
    > > > >
    > > > > Hello,
    > > > >
    > > > > I was hoping to get recommendations on what
    > > > hardware would satisfy
    > > > > the needs of a beginner. I'm a complete newbie
    > who
    > > > knows nothing
    > > > > about microcontrollers, and was hoping that
    > > > someone could give me an
    > > > > idea about where to start.
    > > > >
    > > > > My immediate project only entails very simple
    > > > control commands. The
    > > > > idea is to somehow connect a microcontroller
    > to 4
    > > > different leaf
    > > > > switches, so I can close and open any of the 4
    > > > circuits in any of *14
    > > > > different pre-programmed sequences*. Each
    > sequence
    > > > will have as many
    > > > > as 66 total commands, and will be executed
    > within
    > > > approximately 2
    > > > > minutes. I want to be able to "press a button"
    > at
    > > > anytime along a 5
    > > > > hour time-line to activate any of those 14
    > command
    > > > sequences with
    > > > > timing accuracy between each individual
    > command no
    > > > worse than 1/60th
    > > > > of a second(within that sequence).
    >
    === message truncated ===


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/

    ·

    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 19:56
    Darren,
    Am I right in thinking that you want to 'record' up to 14 different 'tracks'
    each track at most 2 minutes long with a max of 112 moves of the joystick.
    ([noparse][[/noparse]UP 1.2s] - [noparse][[/noparse]DOWN 0.2] - [noparse][[/noparse]LEFT 1.4s] = 3 moves).

    Then when it's done you would like to select which of the 14 tracks you want
    to 'play back' and press the 'play button'.
    Is this what you like to do?
    Is the 'record' joystick the same as the 'playpack' joystick?
    If so, you could use relays, transistors, optocouplers etc connected to
    the STAMP pins across the switches to simulate 'real' closures of
    the contacts.
    Is the joystick 5V....?
    What will be the longest time that you would hold the stick in any given
    direction?

    If this is way off please excuse me!

    Regards and good luck!
    /Henrik Olsson. Sweden.


    Original Message
    >
    > The loads are not at present an issue. After I figure
    > out what electronic components(microcontroller) to
    > get, I will have to figure out a way to interface it
    > to the leaf switches I mentioned. The only "input"
    > criteria for the microcontroller would be to accept
    > any of 8 possible commands it will receive when I
    > manually close and open any of four circuits. The more
    > difficult part would be the output of any of those 8
    > commands, since these circuits(leaf switches) have to
    > by physically closed in order for the PCB on the other
    > end to notice, I'd have to come up with a way to send
    > a strong enough current through the wires to fool
    > it.(I'm actually going to be using the 4-way joystick
    > controls of an arcade game).
    >
    > I don't understand your question about the timing. If
    > I were to "open", let's say switch "B" exactly 1.2
    > seconds after I closed it, I want to microcontroller
    > to output the same(to an accuracy of no worse than
    > 1/60th of a second) when I give it the command to do
    > so. Actually, the longest of the 14 sequences will be
    > 112 different commands in about a two minute
    > period.(And only 1 of the 4 circuits can actually be
    > "closed" at one time).
    >
    > "Some timing requirements may create difficulties with
    > a Basic Stamp, they're not super-fast, and RT requires
    > additional hardware."
    >
    > That is why I'm trying to find out what I'd need to
    > accomplish what I want.(And what is "RT"?).
    >
    > "If what you described means that it would be
    > acceptable if the sequence of switch actions occur
    > within 16 mS of each other in sequence, this can be
    > done. Your 5 hour time line is not clear and may also
    > be a problem."
    >
    > Then forget I mentioned the 5 hour time line. :-)
    >
    > "What exactly are you trying to build? Without more
    > details or a more
    > specific question, you might wind up re-posting this
    > 100 times w/o
    > getting the help you want..."
    >
    > I honestly don't know what I haven't covered, or how
    > to explain anything more clear than I already have. It
    > is a very simple project.
    >
    > Thanks
    >
    > Darren Harris
    > Staten Island, New York.
    >
    > Searcher7@m...
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 19:58
    It's amazing how apparently simple things turn out to
    be so complicated. If I had the tools, I'd actually be
    able to accomplish this with a timer based(mechanical)
    mechanism. Anyway...

    "There may also be problems storing this data fast
    enough to get it saved and then be ready to scan the
    joystick switches again within the 1/60 of a second
    time frame."

    Throughout any sequence, two instructions wouldn't
    occur within about 1/10th of a second anyway.

    "Your main problems are going to be timing and
    storage. Getting the playback to happen at the same
    speed as the recording will be difficult. You will
    have to do some research and find out how long each
    instruction takes and make sure that your playback and
    record loops have the EXACT same execution times."

    Since input would be manual, I don't know how that is
    possible. But if the microcontroller can read my
    manual inputs of a particular sequence, then why
    wouldn't it be able to just duplicate all individual
    commands in that sequence as outputs(with that 1/60th
    of a second accuracy I mentioned)?

    And if storage is an issue, then is there a way to use
    my PC(hard drive)?

    So I'm assuming that a Basic Stamp 2 is what I would
    need for my project? Is there any thing else?

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    ********************************************************************************\
    ********************************************************************************\
    *****
    --- Scott Winn <scott.winn@m...> wrote:
    >
    > So basically you want to 'Record' the movement of
    > the joystick for later
    > playback. In order to do this, you will have to
    > have two 'modes', a record
    > mode and a playback mode. This would have to be
    > switchable via a switch, or
    > maybe a pushbutton that would initiate a 'record'
    > sequence. Then you will
    > also need a way of choosing which sequence you want
    > to play back, and this
    > could be as simple as a number of pushbutton
    > switches.
    >
    > You would have two sections to the program that ran
    > on the stamp.
    >
    > The first would be the recorder and it would be
    > initiated by the record
    > button. You would then move the joystick around and
    > the stamp would scan
    > the joystick switches on the joystick as quickly as
    > it could and store the
    > state of the switches into some sort of a storage
    > device. This portion
    > contains a potential problem, because each sample
    > will have to be stored for
    > later playback and you could potentially have a
    > large amount of storage
    > required. If you are sampling at 1/60 of a second,
    > you will have 4 bits of
    > data for every 1/60 of a second which comes out to
    > 30 bytes per second or
    > 1.8K per minute. That means that each 2 minute
    > sequence will require 1.8K of
    > storage. This will exceed the internal storage
    > ability of the stamp and
    > will require an external storage device. There may
    > also be problems storing
    > this data fast enough to get it saved and then be
    > ready to scan the joystick
    > switches again within the 1/60 of a second time
    > frame. The record process
    > could be terminated by pressing one of the buttons
    > that are used for
    > playback. Once this button press was complete the
    > sequence could be assigned
    > to that button for playback.
    >
    > The playback portion would wait for a button press
    > and when a button was
    > pressed, it would retrieve the data from the
    > external storage device and
    > configure it's pins for outputs. It would then run
    > through a loop and every
    > 1/60 of a second it would retrieve and 'playback'
    > the stored sample for that
    > time period.
    >
    > Basically what you are trying to make is a 4 bit
    > digital recorder.
    >
    > Someone mentioned 'debouncing'. This refers to the
    > fact that a switch
    > doesn't make a clean on/off transistion. It arcs
    > and springs and makes
    > dozens of contacts for each press of the switch.
    > The stamp is fast enough
    > that it can detect these millisecond long contacts.
    > One switch press could
    > be detected as 10 or 20 or more presses because of
    > this effect. I wouldn't
    > worry about this though. What you are trying to do
    > is record the actual
    > movement of the switches on the joystick. The video
    > game that you are
    > playing back into expects the signals to be noisy
    > and will be able to handle
    > it.
    >
    > Your main problems are going to be timing and
    > storage. Getting the playback
    > to happen at the same speed as the recording will be
    > difficult. You will
    > have to do some research and find out how long each
    > instruction takes and
    > make sure that your playback and record loops have
    > the EXACT same execution
    > times.
    >
    > Interupts were also mentioned. What this means is
    > that there are two
    > methods of letting a microcontroller know that
    > something has happened that
    > needs it's attention. With the basic stamp the only
    > way that really exists
    > is for the stamp to be in a loop (a section of code
    > that executes over and
    > over) and just keep looking at an input over and
    > over again until it gets
    > pressed and then it knows it needs to do something.
    > Other Microcontrollers
    > support interupts which are a special input to the
    > microcontroller that will
    > 'interupt' what the processor is doing and FORCE it
    > to execute a section of
    > code when the input happens. This way the processor
    > doesn't have to worry
    > about whether or not any inputs have been pressed
    > until it is interupted and
    > then has to deal with it. This is not an option on
    > the stamp.
    >
    > --Scott
    >
    >
    >
    Original Message
    > From: Darren Harris [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=wN1VhxNTPYwCu5t3ZhF5DAGmKjcpaysEQLUpFmYgFtiTuWmIjhYSaFzU3jE7HB19fL5iv6T_0HBMEy9cCwc2zw]searcher731@y...[/url
    > Sent: Thursday, April 12, 2001 10:18 AM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please
    > :-)
    >
    >
    > "The Basic Stamp 2 will do this as long as you
    > realize
    > that there are no
    > interrupts. This implies that you will need to loop
    > through the 4 inputs
    > continuously and check their state."
    >
    > Providing I understand you correctly, is this a
    > manual
    > process or will the Basic Stamp do this?
    >
    > "As long as the program doesn't take more than 16mS
    > to
    > loop, which is a long time- even for a stamp, you
    > should be OK."
    >
    > "The 'button' instruction will help you 'debounce'
    > your manual switches."
    >
    > This is all Greek to me.
    >
    > "If the toughest loop is 112 commands in 2 minutes
    > or
    > less, you're talking more than 1 second per, so it
    > also is not too fast. More effort will go into
    > making
    > it take 2 minutes, if that's what you need."
    >
    > It is not the length of time. I just said that a
    > sequence may take about 2 minutes.
    >
    > "Just realize that again, while the 112 instructions
    > are executing in their own loop, the only thing the
    > stamp can do is wait for the loop to execute, or be
    > reset."
    >
    > I assume that this means that it will follow the
    > sequence I initiate to it's end, or I can manually
    > reset, and start it(or another sequence) over?
    >
    > "If I were you, I'd read the manual and 'stamps in
    > class' downloads at www.parallaxinc.com"
    >
    > I don't understand much of what you said, but I will
    > check out the manual you mentioned.
    >
    > Nevertheless, here is just one more clarification of
    > the basics of what I'm attempting...
    >
    > ***Years ago there was a multiplayer "family" game
    > advertised on T.V. It entailed a device that would
    > flash lights in a certain sequence. The player would
    > then have to remember and duplicate that sequence by
    > pressing the corresponding lighted buttons. The
    > farther you got into the game the longer the
    > sequence
    > of lights you had to duplicate.(The more difficult
    > it
    > became).
    >
    > Now if you can imagine the computer in the human's
    > place, and vice-versa, you will understand bacically
    > what I'm attempting to accomplish. I will be using a
    > 4-way joystick to "input" 14 separate sequences
    > containing many "on" and "off" commands to all 4
    > connections.(As I said, each sequence will last a
    > maximum of about 2 minutes, and have a total of 112
    > commands). Now, when I press one of 14 buttons, it
    > is
    > the microcontroller that will have to duplicate the
    > corresponding sequence to within 1/60th of a
    > second(between each and every command in that
    > sequence). So for example, if I'm using it on a game
    > like Pacman, the microcontroller will be able to
    > "repeat" any of my patterns, because I would allow
    > it
    > "read" and remember my joystick movements. It will
    >
    === message truncated ===


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 20:08
    I'd think about using a BS2P and storing the recordings in the unused
    program area. You could compress the storage by "run length encoding". So
    you'd say (not real stamp code):

    scancount=0
    eeaddress=0
    laststate=-1
    loop:
    state=getstate ' 0=up, 1=up/right, 2=up, or whatever... never -1
    if state<>laststate then writeit
    scancount=scancount+1
    goto loop

    writeit:
    if laststate=-1 then skipwrite
    write laststate, scancount (to EEPROM)
    eeaddress=eeaddress+1
    skipwrite:
    scancount=1
    laststate=state
    goto loop


    Of course, you need to know when to stop too. This would wind up writing to
    EEPROM a code and a number of "scans" that that code was in force. Playback
    would be similar.

    Just a thought.

    Al Williams
    AWC
    *Expand your Stamp I/O: http://www.al-williams.com/awce/pak3.htm


    >
    Original Message
    > From: Darren Harris [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=jd3oELYKBkLyE03pEpfPOnzdb17uPh0E6gtfGbnBq4w_XmoX1IMAbsGm07_69FR5DQiqXFDyb3xnWdM7UQ]searcher731@y...[/url
    > Sent: Thursday, April 12, 2001 1:59 PM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please :-)
    >
    >
    > It's amazing how apparently simple things turn out to
    > be so complicated. If I had the tools, I'd actually be
    > able to accomplish this with a timer based(mechanical)
    > mechanism. Anyway...
    >
    > "There may also be problems storing this data fast
    > enough to get it saved and then be ready to scan the
    > joystick switches again within the 1/60 of a second
    > time frame."
    >
    > Throughout any sequence, two instructions wouldn't
    > occur within about 1/10th of a second anyway.
    >
    > "Your main problems are going to be timing and
    > storage. Getting the playback to happen at the same
    > speed as the recording will be difficult. You will
    > have to do some research and find out how long each
    > instruction takes and make sure that your playback and
    > record loops have the EXACT same execution times."
    >
    > Since input would be manual, I don't know how that is
    > possible. But if the microcontroller can read my
    > manual inputs of a particular sequence, then why
    > wouldn't it be able to just duplicate all individual
    > commands in that sequence as outputs(with that 1/60th
    > of a second accuracy I mentioned)?
    >
    > And if storage is an issue, then is there a way to use
    > my PC(hard drive)?
    >
    > So I'm assuming that a Basic Stamp 2 is what I would
    > need for my project? Is there any thing else?
    >
    > Thanks
    >
    > Darren Harris
    > Staten Island, New York.
    >
    > Searcher7@m...
    > ******************************************************************
    > ******************************************************************
    > *********************************
    > --- Scott Winn <scott.winn@m...> wrote:
    > >
    > > So basically you want to 'Record' the movement of
    > > the joystick for later
    > > playback. In order to do this, you will have to
    > > have two 'modes', a record
    > > mode and a playback mode. This would have to be
    > > switchable via a switch, or
    > > maybe a pushbutton that would initiate a 'record'
    > > sequence. Then you will
    > > also need a way of choosing which sequence you want
    > > to play back, and this
    > > could be as simple as a number of pushbutton
    > > switches.
    > >
    > > You would have two sections to the program that ran
    > > on the stamp.
    > >
    > > The first would be the recorder and it would be
    > > initiated by the record
    > > button. You would then move the joystick around and
    > > the stamp would scan
    > > the joystick switches on the joystick as quickly as
    > > it could and store the
    > > state of the switches into some sort of a storage
    > > device. This portion
    > > contains a potential problem, because each sample
    > > will have to be stored for
    > > later playback and you could potentially have a
    > > large amount of storage
    > > required. If you are sampling at 1/60 of a second,
    > > you will have 4 bits of
    > > data for every 1/60 of a second which comes out to
    > > 30 bytes per second or
    > > 1.8K per minute. That means that each 2 minute
    > > sequence will require 1.8K of
    > > storage. This will exceed the internal storage
    > > ability of the stamp and
    > > will require an external storage device. There may
    > > also be problems storing
    > > this data fast enough to get it saved and then be
    > > ready to scan the joystick
    > > switches again within the 1/60 of a second time
    > > frame. The record process
    > > could be terminated by pressing one of the buttons
    > > that are used for
    > > playback. Once this button press was complete the
    > > sequence could be assigned
    > > to that button for playback.
    > >
    > > The playback portion would wait for a button press
    > > and when a button was
    > > pressed, it would retrieve the data from the
    > > external storage device and
    > > configure it's pins for outputs. It would then run
    > > through a loop and every
    > > 1/60 of a second it would retrieve and 'playback'
    > > the stored sample for that
    > > time period.
    > >
    > > Basically what you are trying to make is a 4 bit
    > > digital recorder.
    > >
    > > Someone mentioned 'debouncing'. This refers to the
    > > fact that a switch
    > > doesn't make a clean on/off transistion. It arcs
    > > and springs and makes
    > > dozens of contacts for each press of the switch.
    > > The stamp is fast enough
    > > that it can detect these millisecond long contacts.
    > > One switch press could
    > > be detected as 10 or 20 or more presses because of
    > > this effect. I wouldn't
    > > worry about this though. What you are trying to do
    > > is record the actual
    > > movement of the switches on the joystick. The video
    > > game that you are
    > > playing back into expects the signals to be noisy
    > > and will be able to handle
    > > it.
    > >
    > > Your main problems are going to be timing and
    > > storage. Getting the playback
    > > to happen at the same speed as the recording will be
    > > difficult. You will
    > > have to do some research and find out how long each
    > > instruction takes and
    > > make sure that your playback and record loops have
    > > the EXACT same execution
    > > times.
    > >
    > > Interupts were also mentioned. What this means is
    > > that there are two
    > > methods of letting a microcontroller know that
    > > something has happened that
    > > needs it's attention. With the basic stamp the only
    > > way that really exists
    > > is for the stamp to be in a loop (a section of code
    > > that executes over and
    > > over) and just keep looking at an input over and
    > > over again until it gets
    > > pressed and then it knows it needs to do something.
    > > Other Microcontrollers
    > > support interupts which are a special input to the
    > > microcontroller that will
    > > 'interupt' what the processor is doing and FORCE it
    > > to execute a section of
    > > code when the input happens. This way the processor
    > > doesn't have to worry
    > > about whether or not any inputs have been pressed
    > > until it is interupted and
    > > then has to deal with it. This is not an option on
    > > the stamp.
    > >
    > > --Scott
    > >
    > >
    > >
    Original Message
    > > From: Darren Harris [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=jd3oELYKBkLyE03pEpfPOnzdb17uPh0E6gtfGbnBq4w_XmoX1IMAbsGm07_69FR5DQiqXFDyb3xnWdM7UQ]searcher731@y...[/url
    > > Sent: Thursday, April 12, 2001 10:18 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please
    > > :-)
    > >
    > >
    > > "The Basic Stamp 2 will do this as long as you
    > > realize
    > > that there are no
    > > interrupts. This implies that you will need to loop
    > > through the 4 inputs
    > > continuously and check their state."
    > >
    > > Providing I understand you correctly, is this a
    > > manual
    > > process or will the Basic Stamp do this?
    > >
    > > "As long as the program doesn't take more than 16mS
    > > to
    > > loop, which is a long time- even for a stamp, you
    > > should be OK."
    > >
    > > "The 'button' instruction will help you 'debounce'
    > > your manual switches."
    > >
    > > This is all Greek to me.
    > >
    > > "If the toughest loop is 112 commands in 2 minutes
    > > or
    > > less, you're talking more than 1 second per, so it
    > > also is not too fast. More effort will go into
    > > making
    > > it take 2 minutes, if that's what you need."
    > >
    > > It is not the length of time. I just said that a
    > > sequence may take about 2 minutes.
    > >
    > > "Just realize that again, while the 112 instructions
    > > are executing in their own loop, the only thing the
    > > stamp can do is wait for the loop to execute, or be
    > > reset."
    > >
    > > I assume that this means that it will follow the
    > > sequence I initiate to it's end, or I can manually
    > > reset, and start it(or another sequence) over?
    > >
    > > "If I were you, I'd read the manual and 'stamps in
    > > class' downloads at www.parallaxinc.com"
    > >
    > > I don't understand much of what you said, but I will
    > > check out the manual you mentioned.
    > >
    > > Nevertheless, here is just one more clarification of
    > > the basics of what I'm attempting...
    > >
    > > ***Years ago there was a multiplayer "family" game
    > > advertised on T.V. It entailed a device that would
    > > flash lights in a certain sequence. The player would
    > > then have to remember and duplicate that sequence by
    > > pressing the corresponding lighted buttons. The
    > > farther you got into the game the longer the
    > > sequence
    > > of lights you had to duplicate.(The more difficult
    > > it
    > > became).
    > >
    > > Now if you can imagine the computer in the human's
    > > place, and vice-versa, you will understand bacically
    > > what I'm attempting to accomplish. I will be using a
    > > 4-way joystick to "input" 14 separate sequences
    > > containing many "on" and "off" commands to all 4
    > > connections.(As I said, each sequence will last a
    > > maximum of about 2 minutes, and have a total of 112
    > > commands). Now, when I press one of 14 buttons, it
    > > is
    > > the microcontroller that will have to duplicate the
    > > corresponding sequence to within 1/60th of a
    > > second(between each and every command in that
    > > sequence). So for example, if I'm using it on a game
    > > like Pacman, the microcontroller will be able to
    > > "repeat" any of my patterns, because I would allow
    > > it
    > > "read" and remember my joystick movements. It will
    > >
    > === message truncated ===
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Get email at your own domain with Yahoo! Mail.
    > http://personal.mail.yahoo.com/
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 20:16
    At 11:58 AM 4/12/01 -0700, you wrote:

    This is just an idea to conserve memory...


    Read all 4 inputs at once as a single "NIBBLE"

    (forget the button command)

    Instead, read the NEW NIBBLE compared to the PREVIOUS NIBBLE

    (for debounce, read the NEW NIBBLE a couple of times)

    If the NEW NIBBLE is DIFFERENT than the PREVIOUS NIBBLE, then

    log the 'time' and NIBBLE information.

    (The 'time' variable could be an incremental variable inside the
    compare loop between NEW NIBBLE and PREVIOUS NIBBLE it need not
    be $TIME as in HH:MM:SS .... Example: Initialize 'time' to
    Zero before entering the compare loop... Once inside the
    compare loop if NEW NIBBLE equals PREVIOUS NIBBLE then increment
    the 'time' variable. Use this value to determine a relative
    amount of time the Joystick remained in one position.)

    For multiple "tracks" you can segment the memory by a certain

    offset, and just index it upon playback.




    Beau Schwabe IC Mask Designer
    National Semiconductor Network Products Division
    500 Pinnacle Court, Suite 525 Mail Stop GA1 Norcross, GA 30071
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 20:21
    "Am I right in thinking that you want to 'record' up to 14 different
    'tracks'
    each track at most 2 minutes long with a max of 112 moves of the
    joystick.
    ([noparse][[/noparse]UP 1.2s] - [noparse][[/noparse]DOWN 0.2] - [noparse][[/noparse]LEFT 1.4s] = 3 moves)."

    yes. But the return from left, right, up, and down are important also.

    "Then when it's done you would like to select which of the 14 tracks
    you want
    to 'play back' and press the 'play button'.Is this what you like to
    do?"

    Exactly.

    "Is the 'record' joystick the same as the 'playpack' joystick?"

    Actually, I have to find a way to interface the microcontroller to
    the 4 leaf switches that the joystick touches to open and close those
    circuits.

    "If so, you could use relays, transistors, optocouplers etc connected
    to
    the STAMP pins across the switches to simulate 'real'
    closures of
    the contacts."

    Huh? Remember, I'm a newbie. :-)

    "Is the joystick 5V....?"

    Yes.

    "What will be the longest time that you would hold the stick in any
    given
    direction?"

    About 7 seconds.

    "If this is way off please excuse me!"

    Actually, you seem to have a handle on what I'm attempting. I would
    have given even more details as to why I need to do this, but it
    would have been somewhat off topic.

    Thanks.

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    **********************************************************************
    **********************************************************************
    **********************************************************************
    --- In basicstamps@y..., "Henrik Olsson" <henrik-olsson@t...> wrote:
    > Darren,
    > Am I right in thinking that you want to 'record' up to 14 different
    'tracks'
    > each track at most 2 minutes long with a max of 112 moves of the
    joystick.
    > ([noparse][[/noparse]UP 1.2s] - [noparse][[/noparse]DOWN 0.2] - [noparse][[/noparse]LEFT 1.4s] = 3 moves).
    >
    > Then when it's done you would like to select which of the 14 tracks
    you want
    > to 'play back' and press the 'play button'.
    > Is this what you like to do?
    > Is the 'record' joystick the same as the 'playpack' joystick?
    > If so, you could use relays, transistors, optocouplers etc
    connected to
    > the STAMP pins across the switches to simulate 'real'
    closures of
    > the contacts.
    > Is the joystick 5V....?
    > What will be the longest time that you would hold the stick in any
    given
    > direction?
    >
    > If this is way off please excuse me!
    >
    > Regards and good luck!
    > /Henrik Olsson. Sweden.
    >
    >
    >
    Original Message
    >
    > > The loads are not at present an issue. After I figure
    > > out what electronic components(microcontroller) to
    > > get, I will have to figure out a way to interface it
    > > to the leaf switches I mentioned. The only "input"
    > > criteria for the microcontroller would be to accept
    > > any of 8 possible commands it will receive when I
    > > manually close and open any of four circuits. The more
    > > difficult part would be the output of any of those 8
    > > commands, since these circuits(leaf switches) have to
    > > by physically closed in order for the PCB on the other
    > > end to notice, I'd have to come up with a way to send
    > > a strong enough current through the wires to fool
    > > it.(I'm actually going to be using the 4-way joystick
    > > controls of an arcade game).
    > >
    > > I don't understand your question about the timing. If
    > > I were to "open", let's say switch "B" exactly 1.2
    > > seconds after I closed it, I want to microcontroller
    > > to output the same(to an accuracy of no worse than
    > > 1/60th of a second) when I give it the command to do
    > > so. Actually, the longest of the 14 sequences will be
    > > 112 different commands in about a two minute
    > > period.(And only 1 of the 4 circuits can actually be
    > > "closed" at one time).
    > >
    > > "Some timing requirements may create difficulties with
    > > a Basic Stamp, they're not super-fast, and RT requires
    > > additional hardware."
    > >
    > > That is why I'm trying to find out what I'd need to
    > > accomplish what I want.(And what is "RT"?).
    > >
    > > "If what you described means that it would be
    > > acceptable if the sequence of switch actions occur
    > > within 16 mS of each other in sequence, this can be
    > > done. Your 5 hour time line is not clear and may also
    > > be a problem."
    > >
    > > Then forget I mentioned the 5 hour time line. :-)
    > >
    > > "What exactly are you trying to build? Without more
    > > details or a more
    > > specific question, you might wind up re-posting this
    > > 100 times w/o
    > > getting the help you want..."
    > >
    > > I honestly don't know what I haven't covered, or how
    > > to explain anything more clear than I already have. It
    > > is a very simple project.
    > >
    > > Thanks
    > >
    > > Darren Harris
    > > Staten Island, New York.
    > >
    > > Searcher7@m...
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 20:26
    Darren,
    I guess I understood you right.
    You would need some sort of interface between the joystick and STAMP. If the
    joystick's switches is connected to +5V only you could connect the switches
    direct to the STAMP pins - for the recordmode, that is. For the playbackmode
    you can use transistors conected across the switches in the joystick and
    drive the base or gate of the transistor from another STAMP pin.
    If it's not 5V on the joystick it gets a little more complicated but it sure
    can be done. Is it 5V or 12V or maby 230VAC?
    On the software side Scott gave you a couple of good ideas but like he says
    the storagespace is the problem. Maby you can use an external EEPROM or RAM
    connected to the STAMP.
    Or you could just the skip the STAMP and connect the four switches to
    LPT-port on your PC and record days and weeks of sequences.

    Good luck!
    /Henrik Olsson. Sweden.

    Original Message
    From: "Darren Harris" <searcher731@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Thursday, April 12, 2001 8:58 PM
    Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please :-)


    > It's amazing how apparently simple things turn out to
    > be so complicated. If I had the tools, I'd actually be
    > able to accomplish this with a timer based(mechanical)
    > mechanism. Anyway...
    >
    > "There may also be problems storing this data fast
    > enough to get it saved and then be ready to scan the
    > joystick switches again within the 1/60 of a second
    > time frame."
    >
    > Throughout any sequence, two instructions wouldn't
    > occur within about 1/10th of a second anyway.
    >
    > "Your main problems are going to be timing and
    > storage. Getting the playback to happen at the same
    > speed as the recording will be difficult. You will
    > have to do some research and find out how long each
    > instruction takes and make sure that your playback and
    > record loops have the EXACT same execution times."
    >
    > Since input would be manual, I don't know how that is
    > possible. But if the microcontroller can read my
    > manual inputs of a particular sequence, then why
    > wouldn't it be able to just duplicate all individual
    > commands in that sequence as outputs(with that 1/60th
    > of a second accuracy I mentioned)?
    >
    > And if storage is an issue, then is there a way to use
    > my PC(hard drive)?
    >
    > So I'm assuming that a Basic Stamp 2 is what I would
    > need for my project? Is there any thing else?
    >
    > Thanks
    >
    > Darren Harris
    > Staten Island, New York.
    >
    > Searcher7@m...
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 20:27
    I assume that what you said(whatever it all meant) is too complicated
    to be covered in a manual that would come along with the BS2P(which I
    assume is the Basic Stamp 2?).

    It seems as though I'm going to have to do a lot of studying to
    figure out how these things work.(But I'll save these messages for
    reference).

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    **********************************************************************
    **********************************************************************
    **********************************************************************



    --- In basicstamps@y..., "Al Williams" <alw@a...> wrote:
    > I'd think about using a BS2P and storing the recordings in the
    unused
    > program area. You could compress the storage by "run length
    encoding". So
    > you'd say (not real stamp code):
    >
    > scancount=0
    > eeaddress=0
    > laststate=-1
    > loop:
    > state=getstate ' 0=up, 1=up/right, 2=up, or whatever... never -1
    > if state<>laststate then writeit
    > scancount=scancount+1
    > goto loop
    >
    > writeit:
    > if laststate=-1 then skipwrite
    > write laststate, scancount (to EEPROM)
    > eeaddress=eeaddress+1
    > skipwrite:
    > scancount=1
    > laststate=state
    > goto loop
    >
    >
    > Of course, you need to know when to stop too. This would wind up
    writing to
    > EEPROM a code and a number of "scans" that that code was in force.
    Playback
    > would be similar.
    >
    > Just a thought.
    >
    > Al Williams
    > AWC
    > *Expand your Stamp I/O: http://www.al-williams.com/awce/pak3.htm
    >
    >
    > >
    Original Message
    > > From: Darren Harris [noparse][[/noparse]mailto:searcher731@y...]
    > > Sent: Thursday, April 12, 2001 1:59 PM
    > > To: basicstamps@y...
    > > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please :-)
    > >
    > >
    > > It's amazing how apparently simple things turn out to
    > > be so complicated. If I had the tools, I'd actually be
    > > able to accomplish this with a timer based(mechanical)
    > > mechanism. Anyway...
    > >
    > > "There may also be problems storing this data fast
    > > enough to get it saved and then be ready to scan the
    > > joystick switches again within the 1/60 of a second
    > > time frame."
    > >
    > > Throughout any sequence, two instructions wouldn't
    > > occur within about 1/10th of a second anyway.
    > >
    > > "Your main problems are going to be timing and
    > > storage. Getting the playback to happen at the same
    > > speed as the recording will be difficult. You will
    > > have to do some research and find out how long each
    > > instruction takes and make sure that your playback and
    > > record loops have the EXACT same execution times."
    > >
    > > Since input would be manual, I don't know how that is
    > > possible. But if the microcontroller can read my
    > > manual inputs of a particular sequence, then why
    > > wouldn't it be able to just duplicate all individual
    > > commands in that sequence as outputs(with that 1/60th
    > > of a second accuracy I mentioned)?
    > >
    > > And if storage is an issue, then is there a way to use
    > > my PC(hard drive)?
    > >
    > > So I'm assuming that a Basic Stamp 2 is what I would
    > > need for my project? Is there any thing else?
    > >
    > > Thanks
    > >
    > > Darren Harris
    > > Staten Island, New York.
    > >
    > > Searcher7@m...
    > > ******************************************************************
    > > ******************************************************************
    > > *********************************
    > > --- Scott Winn <scott.winn@m...> wrote:
    > > >
    > > > So basically you want to 'Record' the movement of
    > > > the joystick for later
    > > > playback. In order to do this, you will have to
    > > > have two 'modes', a record
    > > > mode and a playback mode. This would have to be
    > > > switchable via a switch, or
    > > > maybe a pushbutton that would initiate a 'record'
    > > > sequence. Then you will
    > > > also need a way of choosing which sequence you want
    > > > to play back, and this
    > > > could be as simple as a number of pushbutton
    > > > switches.
    > > >
    > > > You would have two sections to the program that ran
    > > > on the stamp.
    > > >
    > > > The first would be the recorder and it would be
    > > > initiated by the record
    > > > button. You would then move the joystick around and
    > > > the stamp would scan
    > > > the joystick switches on the joystick as quickly as
    > > > it could and store the
    > > > state of the switches into some sort of a storage
    > > > device. This portion
    > > > contains a potential problem, because each sample
    > > > will have to be stored for
    > > > later playback and you could potentially have a
    > > > large amount of storage
    > > > required. If you are sampling at 1/60 of a second,
    > > > you will have 4 bits of
    > > > data for every 1/60 of a second which comes out to
    > > > 30 bytes per second or
    > > > 1.8K per minute. That means that each 2 minute
    > > > sequence will require 1.8K of
    > > > storage. This will exceed the internal storage
    > > > ability of the stamp and
    > > > will require an external storage device. There may
    > > > also be problems storing
    > > > this data fast enough to get it saved and then be
    > > > ready to scan the joystick
    > > > switches again within the 1/60 of a second time
    > > > frame. The record process
    > > > could be terminated by pressing one of the buttons
    > > > that are used for
    > > > playback. Once this button press was complete the
    > > > sequence could be assigned
    > > > to that button for playback.
    > > >
    > > > The playback portion would wait for a button press
    > > > and when a button was
    > > > pressed, it would retrieve the data from the
    > > > external storage device and
    > > > configure it's pins for outputs. It would then run
    > > > through a loop and every
    > > > 1/60 of a second it would retrieve and 'playback'
    > > > the stored sample for that
    > > > time period.
    > > >
    > > > Basically what you are trying to make is a 4 bit
    > > > digital recorder.
    > > >
    > > > Someone mentioned 'debouncing'. This refers to the
    > > > fact that a switch
    > > > doesn't make a clean on/off transistion. It arcs
    > > > and springs and makes
    > > > dozens of contacts for each press of the switch.
    > > > The stamp is fast enough
    > > > that it can detect these millisecond long contacts.
    > > > One switch press could
    > > > be detected as 10 or 20 or more presses because of
    > > > this effect. I wouldn't
    > > > worry about this though. What you are trying to do
    > > > is record the actual
    > > > movement of the switches on the joystick. The video
    > > > game that you are
    > > > playing back into expects the signals to be noisy
    > > > and will be able to handle
    > > > it.
    > > >
    > > > Your main problems are going to be timing and
    > > > storage. Getting the playback
    > > > to happen at the same speed as the recording will be
    > > > difficult. You will
    > > > have to do some research and find out how long each
    > > > instruction takes and
    > > > make sure that your playback and record loops have
    > > > the EXACT same execution
    > > > times.
    > > >
    > > > Interupts were also mentioned. What this means is
    > > > that there are two
    > > > methods of letting a microcontroller know that
    > > > something has happened that
    > > > needs it's attention. With the basic stamp the only
    > > > way that really exists
    > > > is for the stamp to be in a loop (a section of code
    > > > that executes over and
    > > > over) and just keep looking at an input over and
    > > > over again until it gets
    > > > pressed and then it knows it needs to do something.
    > > > Other Microcontrollers
    > > > support interupts which are a special input to the
    > > > microcontroller that will
    > > > 'interupt' what the processor is doing and FORCE it
    > > > to execute a section of
    > > > code when the input happens. This way the processor
    > > > doesn't have to worry
    > > > about whether or not any inputs have been pressed
    > > > until it is interupted and
    > > > then has to deal with it. This is not an option on
    > > > the stamp.
    > > >
    > > > --Scott
    > > >
    > > >
    > > >
    Original Message
    > > > From: Darren Harris [noparse][[/noparse]mailto:searcher731@y...]
    > > > Sent: Thursday, April 12, 2001 10:18 AM
    > > > To: basicstamps@y...
    > > > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please
    > > > :-)
    > > >
    > > >
    > > > "The Basic Stamp 2 will do this as long as you
    > > > realize
    > > > that there are no
    > > > interrupts. This implies that you will need to loop
    > > > through the 4 inputs
    > > > continuously and check their state."
    > > >
    > > > Providing I understand you correctly, is this a
    > > > manual
    > > > process or will the Basic Stamp do this?
    > > >
    > > > "As long as the program doesn't take more than 16mS
    > > > to
    > > > loop, which is a long time- even for a stamp, you
    > > > should be OK."
    > > >
    > > > "The 'button' instruction will help you 'debounce'
    > > > your manual switches."
    > > >
    > > > This is all Greek to me.
    > > >
    > > > "If the toughest loop is 112 commands in 2 minutes
    > > > or
    > > > less, you're talking more than 1 second per, so it
    > > > also is not too fast. More effort will go into
    > > > making
    > > > it take 2 minutes, if that's what you need."
    > > >
    > > > It is not the length of time. I just said that a
    > > > sequence may take about 2 minutes.
    > > >
    > > > "Just realize that again, while the 112 instructions
    > > > are executing in their own loop, the only thing the
    > > > stamp can do is wait for the loop to execute, or be
    > > > reset."
    > > >
    > > > I assume that this means that it will follow the
    > > > sequence I initiate to it's end, or I can manually
    > > > reset, and start it(or another sequence) over?
    > > >
    > > > "If I were you, I'd read the manual and 'stamps in
    > > > class' downloads at www.parallaxinc.com"
    > > >
    > > > I don't understand much of what you said, but I will
    > > > check out the manual you mentioned.
    > > >
    > > > Nevertheless, here is just one more clarification of
    > > > the basics of what I'm attempting...
    > > >
    > > > ***Years ago there was a multiplayer "family" game
    > > > advertised on T.V. It entailed a device that would
    > > > flash lights in a certain sequence. The player would
    > > > then have to remember and duplicate that sequence by
    > > > pressing the corresponding lighted buttons. The
    > > > farther you got into the game the longer the
    > > > sequence
    > > > of lights you had to duplicate.(The more difficult
    > > > it
    > > > became).
    > > >
    > > > Now if you can imagine the computer in the human's
    > > > place, and vice-versa, you will understand bacically
    > > > what I'm attempting to accomplish. I will be using a
    > > > 4-way joystick to "input" 14 separate sequences
    > > > containing many "on" and "off" commands to all 4
    > > > connections.(As I said, each sequence will last a
    > > > maximum of about 2 minutes, and have a total of 112
    > > > commands). Now, when I press one of 14 buttons, it
    > > > is
    > > > the microcontroller that will have to duplicate the
    > > > corresponding sequence to within 1/60th of a
    > > > second(between each and every command in that
    > > > sequence). So for example, if I'm using it on a game
    > > > like Pacman, the microcontroller will be able to
    > > > "repeat" any of my patterns, because I would allow
    > > > it
    > > > "read" and remember my joystick movements. It will
    > > >
    > > === message truncated ===
    > >
    > >
    > > __________________________________________________
    > > Do You Yahoo!?
    > > Get email at your own domain with Yahoo! Mail.
    > > http://personal.mail.yahoo.com/
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 20:53
    "This is just an idea to conserve memory...
    Read all 4 inputs at once as a single "NIBBLE"(forget
    the button command)
    Instead, read the NEW NIBBLE compared to the PREVIOUS
    NIBBLE
    (for debounce, read the NEW NIBBLE a couple of times)
    If the NEW NIBBLE is DIFFERENT than the PREVIOUS
    NIBBLE, then
    log the 'time' and NIBBLE information."

    1)But the same "NIBBLE" will not occur on consecutive
    commands.
    2)No two commands will occur within about 1/10th of a
    second of each other.
    3)It's really 8 commands, since the release is just as
    important.

    "(The 'time' variable could be an incremental variable
    inside the
    compare loop between NEW NIBBLE and PREVIOUS NIBBLE
    it need not
    be $TIME as in HH:MM:SS .... Example:
    Initialize 'time' to
    Zero before entering the compare loop... Once
    inside the
    compare loop if NEW NIBBLE equals PREVIOUS NIBBLE
    then increment
    the 'time' variable. Use this value to determine a
    relative
    amount of time the Joystick remained in one
    position.)"

    If I understand you correctly, time would start at
    zero as of the "PREVIOUS NIBBLE". If timing accuracy
    will not suffer it would be the obvious way to go. BIG
    QUESTION: Is it too unreasonable to expect that the
    accuracy between the very first and very last
    commands(over a span of about 2 minutes) will be
    within that 1/60th of a second window?

    "For multiple "tracks" you can segment the memory by a
    certain
    offset, and just index it upon playback."

    I assume something simple like 1, 2, 3, 4, 5, 6, 7,
    and 8?

    If I sound naive, it's because I know nothing about
    electronics.(I'm a amateur(mechanical) inventor).

    Thanks.

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    ********************************************************************************\
    ********************************************************************************\
    *****
    --- Beau Schwabe <bschwabe@a...> wrote:
    > At 11:58 AM 4/12/01 -0700, you wrote:
    >
    > This is just an idea to conserve memory...
    >
    >
    > Read all 4 inputs at once as a single "NIBBLE"
    >
    > (forget the button command)
    >
    > Instead, read the NEW NIBBLE compared to the
    > PREVIOUS NIBBLE
    >
    > (for debounce, read the NEW NIBBLE a couple of
    > times)
    >
    > If the NEW NIBBLE is DIFFERENT than the PREVIOUS
    > NIBBLE, then
    >
    > log the 'time' and NIBBLE information.
    >
    > (The 'time' variable could be an incremental
    > variable inside the
    > compare loop between NEW NIBBLE and PREVIOUS
    > NIBBLE it need not
    > be $TIME as in HH:MM:SS .... Example:
    > Initialize 'time' to
    > Zero before entering the compare loop... Once
    > inside the
    > compare loop if NEW NIBBLE equals PREVIOUS NIBBLE
    > then increment
    > the 'time' variable. Use this value to determine
    > a relative
    > amount of time the Joystick remained in one
    > position.)
    >
    > For multiple "tracks" you can segment the memory by
    > a certain
    >
    > offset, and just index it upon playback.
    >
    >
    >
    >
    > Beau Schwabe IC Mask Designer
    > National Semiconductor Network Products
    > Division
    > 500 Pinnacle Court, Suite 525 Mail Stop GA1
    > Norcross, GA 30071
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 20:56

    Original Message
    > Huh? Remember, I'm a newbie. :-)

    OK!
    The 'safest' way to simulate switch-closures is to use an opto-coupler. It
    concists of a LED and a transistor in one DIP-package (or SMD for that
    matter).

    It works like this: When you drive current thru the LED the transistor will
    conduct and current can flow from the collector to the emitter - quite
    simple! The only connection is by light so there's _allmost_ no way that the
    STAMP can be hurt if any thing goes wrong in 'the other end'.

    The first thing you need to do is findout if the signals going from the
    switches to 'whatever' is at 0V when you don't do anything with the stick
    and at 5V when you push up for example.

    If that is the case you would connect the COLLECTOR on the optocoupler (pin5
    on MOST (not all) 6-pin optocouplers) to the one side of the switch that
    allways is at 5V and the EMITTER on the optocoupler (pin6) to the 'other'
    side of the switch.

    Now, if you ground the cathode of the LED in the optocoupler (often pin 2)
    and connect a 330ohm resistor between the anode (pin1) and a STAMP pin you
    can 'simulate' a 1 second switch closure by for example:

    High 4 'Put 5V on I/O 4 on the STAMP, making the LED in the
    optoc. light up.
    Pause 1000 'Wait 1000mS
    Low 4 'Remove the 5V on I/O 4, making the LED go off.

    Look up some optocoupler like TIL111, CNY17 H11A1, etc or the PC847 - four
    in one. You'll see what I meen.

    There are many other ways to do it, this is just one. Maby you don't really
    need the optocoupler at all scince it's a 5V system, but it protects the
    stamp.

    Did it make it any clearer for you or did I just made more complicated for
    you?
    If you want I can draw a simple schematic and send to you off-list.
    Sorry I can't help you much on the software side :-( I'm going to think
    about it though.

    Let us know how it goes.

    /Henrik Olsson. Sweden.



    >
    > "Is the joystick 5V....?"
    >
    > Yes.
    >
    > "What will be the longest time that you would hold the stick in any
    > given
    > direction?"
    >
    > About 7 seconds.
    >
    > "If this is way off please excuse me!"
    >
    > Actually, you seem to have a handle on what I'm attempting. I would
    > have given even more details as to why I need to do this, but it
    > would have been somewhat off topic.
    >
    > Thanks.
    >
    > Darren Harris
    > Staten Island, New York.
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 21:00
    "Or you could just the skip the STAMP and connect the
    four switches to
    LPT-port on your PC and record days and weeks of
    sequences."

    For real? I heard this mentioned before, but have no
    idea how to go about getting it done. Is it
    easier/more accurate/cheaper than the Stamp idea(for
    this beginner)?

    Are there any simular projects out there that I can't
    study and adapt for my purposes?

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    ********************************************************************************\
    ********************************************************************************\
    *****
    --- Henrik Olsson <henrik-olsson@t...> wrote:
    > Darren,
    > I guess I understood you right.
    > You would need some sort of interface between the
    > joystick and STAMP. If the
    > joystick's switches is connected to +5V only you
    > could connect the switches
    > direct to the STAMP pins - for the recordmode, that
    > is. For the playbackmode
    > you can use transistors conected across the switches
    > in the joystick and
    > drive the base or gate of the transistor from
    > another STAMP pin.
    > If it's not 5V on the joystick it gets a little more
    > complicated but it sure
    > can be done. Is it 5V or 12V or maby 230VAC?
    > On the software side Scott gave you a couple of good
    > ideas but like he says
    > the storagespace is the problem. Maby you can use an
    > external EEPROM or RAM
    > connected to the STAMP.
    > Or you could just the skip the STAMP and connect the
    > four switches to
    > LPT-port on your PC and record days and weeks of
    > sequences.
    >
    > Good luck!
    > /Henrik Olsson. Sweden.
    >
    >
    Original Message
    > From: "Darren Harris" <searcher731@y...>
    > To: <basicstamps@yahoogroups.com>
    > Sent: Thursday, April 12, 2001 8:58 PM
    > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please
    > :-)
    >
    >
    > > It's amazing how apparently simple things turn out
    > to
    > > be so complicated. If I had the tools, I'd
    > actually be
    > > able to accomplish this with a timer
    > based(mechanical)
    > > mechanism. Anyway...
    > >
    > > "There may also be problems storing this data fast
    > > enough to get it saved and then be ready to scan
    > the
    > > joystick switches again within the 1/60 of a
    > second
    > > time frame."
    > >
    > > Throughout any sequence, two instructions wouldn't
    > > occur within about 1/10th of a second anyway.
    > >
    > > "Your main problems are going to be timing and
    > > storage. Getting the playback to happen at the
    > same
    > > speed as the recording will be difficult. You
    > will
    > > have to do some research and find out how long
    > each
    > > instruction takes and make sure that your playback
    > and
    > > record loops have the EXACT same execution times."
    > >
    > > Since input would be manual, I don't know how that
    > is
    > > possible. But if the microcontroller can read my
    > > manual inputs of a particular sequence, then why
    > > wouldn't it be able to just duplicate all
    > individual
    > > commands in that sequence as outputs(with that
    > 1/60th
    > > of a second accuracy I mentioned)?
    > >
    > > And if storage is an issue, then is there a way to
    > use
    > > my PC(hard drive)?
    > >
    > > So I'm assuming that a Basic Stamp 2 is what I
    > would
    > > need for my project? Is there any thing else?
    > >
    > > Thanks
    > >
    > > Darren Harris
    > > Staten Island, New York.
    > >
    > > Searcher7@m...
    > >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 21:00
    >"This is just an idea to conserve memory...
    >
    >1)But the same "NIBBLE" will not occur on consecutive
    >commands.

    In the time the BS2 or PIC can "read" the four switches,
    YES, it could...


    >2)No two commands will occur within about 1/10th of a
    >second of each other.

    SLOW for a PIC... questionable for a BS2

    >3)It's really 8 commands, since the release is just as
    >important.

    YES!, the NIBBLE recording method I mention would ONLY
    record a "change" in any of the switch positions. Thus
    a switch close or a switch open would be recorded.





    Beau Schwabe IC Mask Designer
    National Semiconductor Network Products Division
    500 Pinnacle Court, Suite 525 Mail Stop GA1 Norcross, GA 30071
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 21:10
    Well, I guess it could be done i QBASIC or VB but I'm not very good at those
    (either). Besides this isn't really the place to disscus non STAMP-things.
    The hardware side would be axactly the same for a PC as for a STAMP.
    Do you know VB at all?
    You could set up a timer that reads the LPT-port once every 1/10th seconds,
    put the value in file. And then read the file back one line every 1/10th
    second (or whaever) and write it back to the LPT-port. But like I said,
    don't ask me axactly how to do it.


    > "Or you could just the skip the STAMP and connect the
    > four switches to
    > LPT-port on your PC and record days and weeks of
    > sequences."
    >
    > For real? I heard this mentioned before, but have no
    > idea how to go about getting it done. Is it
    > easier/more accurate/cheaper than the Stamp idea(for
    > this beginner)?
    >
    > Are there any simular projects out there that I can't
    > study and adapt for my purposes?
    >
    > Thanks
    >
    > Darren Harris
    > Staten Island, New York.
    >
    > Searcher7@m...
    >
    ****************************************************************************
    ****************************************************************************
    *************
    > --- Henrik Olsson <henrik-olsson@t...> wrote:
    > > Darren,
    > > I guess I understood you right.
    > > You would need some sort of interface between the
    > > joystick and STAMP. If the
    > > joystick's switches is connected to +5V only you
    > > could connect the switches
    > > direct to the STAMP pins - for the recordmode, that
    > > is. For the playbackmode
    > > you can use transistors conected across the switches
    > > in the joystick and
    > > drive the base or gate of the transistor from
    > > another STAMP pin.
    > > If it's not 5V on the joystick it gets a little more
    > > complicated but it sure
    > > can be done. Is it 5V or 12V or maby 230VAC?
    > > On the software side Scott gave you a couple of good
    > > ideas but like he says
    > > the storagespace is the problem. Maby you can use an
    > > external EEPROM or RAM
    > > connected to the STAMP.
    > > Or you could just the skip the STAMP and connect the
    > > four switches to
    > > LPT-port on your PC and record days and weeks of
    > > sequences.
    > >
    > > Good luck!
    > > /Henrik Olsson. Sweden.
    > >
    > >
    Original Message
    > > From: "Darren Harris" <searcher731@y...>
    > > To: <basicstamps@yahoogroups.com>
    > > Sent: Thursday, April 12, 2001 8:58 PM
    > > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations please
    > > :-)
    > >
    > >
    > > > It's amazing how apparently simple things turn out
    > > to
    > > > be so complicated. If I had the tools, I'd
    > > actually be
    > > > able to accomplish this with a timer
    > > based(mechanical)
    > > > mechanism. Anyway...
    > > >
    > > > "There may also be problems storing this data fast
    > > > enough to get it saved and then be ready to scan
    > > the
    > > > joystick switches again within the 1/60 of a
    > > second
    > > > time frame."
    > > >
    > > > Throughout any sequence, two instructions wouldn't
    > > > occur within about 1/10th of a second anyway.
    > > >
    > > > "Your main problems are going to be timing and
    > > > storage. Getting the playback to happen at the
    > > same
    > > > speed as the recording will be difficult. You
    > > will
    > > > have to do some research and find out how long
    > > each
    > > > instruction takes and make sure that your playback
    > > and
    > > > record loops have the EXACT same execution times."
    > > >
    > > > Since input would be manual, I don't know how that
    > > is
    > > > possible. But if the microcontroller can read my
    > > > manual inputs of a particular sequence, then why
    > > > wouldn't it be able to just duplicate all
    > > individual
    > > > commands in that sequence as outputs(with that
    > > 1/60th
    > > > of a second accuracy I mentioned)?
    > > >
    > > > And if storage is an issue, then is there a way to
    > > use
    > > > my PC(hard drive)?
    > > >
    > > > So I'm assuming that a Basic Stamp 2 is what I
    > > would
    > > > need for my project? Is there any thing else?
    > > >
    > > > Thanks
    > > >
    > > > Darren Harris
    > > > Staten Island, New York.
    > > >
    > > > Searcher7@m...
    > > >
    > >
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Get email at your own domain with Yahoo! Mail.
    > http://personal.mail.yahoo.com/
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 21:11
    Hmmmm. Perhaps I should send the joystick assembly to
    someone qualified to do this. :-)

    I have a mind like a computer.(Not a good thing). If
    every detail is not explained to me perfectly, in a
    step-by-step manner, I'd get stuck on the smallest
    things.

    So I don't know how much good a diagram would do in
    view of the fact that those electronic terms you used
    are alien to me.

    I really need a book to study.(One with project
    examples(and pictures)). :-)

    Thanks.

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    ********************************************************************************\
    ********************************************************************************\
    *****


    --- Henrik Olsson <henrik-olsson@t...> wrote:
    >
    >
    Original Message
    > > Huh? Remember, I'm a newbie. :-)
    >
    > OK!
    > The 'safest' way to simulate switch-closures is to
    > use an opto-coupler. It
    > concists of a LED and a transistor in one
    > DIP-package (or SMD for that
    > matter).
    >
    > It works like this: When you drive current thru the
    > LED the transistor will
    > conduct and current can flow from the collector to
    > the emitter - quite
    > simple! The only connection is by light so there's
    > _allmost_ no way that the
    > STAMP can be hurt if any thing goes wrong in 'the
    > other end'.
    >
    > The first thing you need to do is findout if the
    > signals going from the
    > switches to 'whatever' is at 0V when you don't do
    > anything with the stick
    > and at 5V when you push up for example.
    >
    > If that is the case you would connect the COLLECTOR
    > on the optocoupler (pin5
    > on MOST (not all) 6-pin optocouplers) to the one
    > side of the switch that
    > allways is at 5V and the EMITTER on the optocoupler
    > (pin6) to the 'other'
    > side of the switch.
    >
    > Now, if you ground the cathode of the LED in the
    > optocoupler (often pin 2)
    > and connect a 330ohm resistor between the anode
    > (pin1) and a STAMP pin you
    > can 'simulate' a 1 second switch closure by for
    > example:
    >
    > High 4 'Put 5V on I/O 4 on the STAMP,
    > making the LED in the
    > optoc. light up.
    > Pause 1000 'Wait 1000mS
    > Low 4 'Remove the 5V on I/O 4, making
    > the LED go off.
    >
    > Look up some optocoupler like TIL111, CNY17 H11A1,
    > etc or the PC847 - four
    > in one. You'll see what I meen.
    >
    > There are many other ways to do it, this is just
    > one. Maby you don't really
    > need the optocoupler at all scince it's a 5V system,
    > but it protects the
    > stamp.
    >
    > Did it make it any clearer for you or did I just
    > made more complicated for
    > you?
    > If you want I can draw a simple schematic and send
    > to you off-list.
    > Sorry I can't help you much on the software side :-(
    > I'm going to think
    > about it though.
    >
    > Let us know how it goes.
    >
    > /Henrik Olsson. Sweden.
    >
    >
    >
    > >
    > > "Is the joystick 5V....?"
    > >
    > > Yes.
    > >
    > > "What will be the longest time that you would hold
    > the stick in any
    > > given
    > > direction?"
    > >
    > > About 7 seconds.
    > >
    > > "If this is way off please excuse me!"
    > >
    > > Actually, you seem to have a handle on what I'm
    > attempting. I would
    > > have given even more details as to why I need to
    > do this, but it
    > > would have been somewhat off topic.
    > >
    > > Thanks.
    > >
    > > Darren Harris
    > > Staten Island, New York.
    >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 21:27
    >"This is just an idea to conserve memory...>
    >1)But the same "NIBBLE" will not occur on
    consecutive>commands.

    "In the time the BS2 or PIC can "read" the four
    switches,YES, it could..."

    Actually, since the input is completely manual, I know
    that my joystick movements cannot occur that close
    together, and never in the same direction twice in a
    row(unless you are somehow talking about "open" and
    "Close" on the same pin being considered the same
    command).

    "> In the time the BS2 or PIC can "read" the four
    > switches,
    > YES, it could..."

    If it takes that long, then the stamp would be useless
    to me.

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    ********************************************************************************\
    ********************************************************************************\
    *****
    --- Beau Schwabe <bschwabe@a...> wrote:
    >
    > >"This is just an idea to conserve memory...
    > >
    > >1)But the same "NIBBLE" will not occur on
    > consecutive
    > >commands.
    >
    > In the time the BS2 or PIC can "read" the four
    > switches,
    > YES, it could...
    >
    >
    > >2)No two commands will occur within about 1/10th of
    > a
    > >second of each other.
    >
    > SLOW for a PIC... questionable for a BS2
    >
    > >3)It's really 8 commands, since the release is just
    > as
    > >important.
    >
    > YES!, the NIBBLE recording method I mention would
    > ONLY
    > record a "change" in any of the switch positions.
    > Thus
    > a switch close or a switch open would be recorded.
    >
    >
    >
    >
    >
    > Beau Schwabe IC Mask Designer
    > National Semiconductor Network Products
    > Division
    > 500 Pinnacle Court, Suite 525 Mail Stop GA1
    > Norcross, GA 30071
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 21:30
    1/10th of a second would not be accurate enough
    anyway.

    Thanks

    Darren Harris
    Staten Island, New York.

    Searcher7@m...
    ********************************************************************************\
    ********************************************************************************\
    *****
    --- Henrik Olsson <henrik-olsson@t...> wrote:
    > Well, I guess it could be done i QBASIC or VB but
    > I'm not very good at those
    > (either). Besides this isn't really the place to
    > disscus non STAMP-things.
    > The hardware side would be axactly the same for a PC
    > as for a STAMP.
    > Do you know VB at all?
    > You could set up a timer that reads the LPT-port
    > once every 1/10th seconds,
    > put the value in file. And then read the file back
    > one line every 1/10th
    > second (or whaever) and write it back to the
    > LPT-port. But like I said,
    > don't ask me axactly how to do it.
    >
    >
    > > "Or you could just the skip the STAMP and connect
    > the
    > > four switches to
    > > LPT-port on your PC and record days and weeks of
    > > sequences."
    > >
    > > For real? I heard this mentioned before, but have
    > no
    > > idea how to go about getting it done. Is it
    > > easier/more accurate/cheaper than the Stamp
    > idea(for
    > > this beginner)?
    > >
    > > Are there any simular projects out there that I
    > can't
    > > study and adapt for my purposes?
    > >
    > > Thanks
    > >
    > > Darren Harris
    > > Staten Island, New York.
    > >
    > > Searcher7@m...
    > >
    >
    ****************************************************************************
    >
    ****************************************************************************
    > *************
    > > --- Henrik Olsson <henrik-olsson@t...> wrote:
    > > > Darren,
    > > > I guess I understood you right.
    > > > You would need some sort of interface between
    > the
    > > > joystick and STAMP. If the
    > > > joystick's switches is connected to +5V only you
    > > > could connect the switches
    > > > direct to the STAMP pins - for the recordmode,
    > that
    > > > is. For the playbackmode
    > > > you can use transistors conected across the
    > switches
    > > > in the joystick and
    > > > drive the base or gate of the transistor from
    > > > another STAMP pin.
    > > > If it's not 5V on the joystick it gets a little
    > more
    > > > complicated but it sure
    > > > can be done. Is it 5V or 12V or maby 230VAC?
    > > > On the software side Scott gave you a couple of
    > good
    > > > ideas but like he says
    > > > the storagespace is the problem. Maby you can
    > use an
    > > > external EEPROM or RAM
    > > > connected to the STAMP.
    > > > Or you could just the skip the STAMP and connect
    > the
    > > > four switches to
    > > > LPT-port on your PC and record days and weeks of
    > > > sequences.
    > > >
    > > > Good luck!
    > > > /Henrik Olsson. Sweden.
    > > >
    > > >
    Original Message
    > > > From: "Darren Harris" <searcher731@y...>
    > > > To: <basicstamps@yahoogroups.com>
    > > > Sent: Thursday, April 12, 2001 8:58 PM
    > > > Subject: RE: [noparse][[/noparse]basicstamps] Recommendations
    > please
    > > > :-)
    > > >
    > > >
    > > > > It's amazing how apparently simple things turn
    > out
    > > > to
    > > > > be so complicated. If I had the tools, I'd
    > > > actually be
    > > > > able to accomplish this with a timer
    > > > based(mechanical)
    > > > > mechanism. Anyway...
    > > > >
    > > > > "There may also be problems storing this data
    > fast
    > > > > enough to get it saved and then be ready to
    > scan
    > > > the
    > > > > joystick switches again within the 1/60 of a
    > > > second
    > > > > time frame."
    > > > >
    > > > > Throughout any sequence, two instructions
    > wouldn't
    > > > > occur within about 1/10th of a second anyway.
    > > > >
    > > > > "Your main problems are going to be timing and
    > > > > storage. Getting the playback to happen at
    > the
    > > > same
    > > > > speed as the recording will be difficult. You
    > > > will
    > > > > have to do some research and find out how long
    > > > each
    > > > > instruction takes and make sure that your
    > playback
    > > > and
    > > > > record loops have the EXACT same execution
    > times."
    > > > >
    > > > > Since input would be manual, I don't know how
    > that
    > > > is
    > > > > possible. But if the microcontroller can read
    > my
    > > > > manual inputs of a particular sequence, then
    > why
    > > > > wouldn't it be able to just duplicate all
    > > > individual
    > > > > commands in that sequence as outputs(with that
    > > > 1/60th
    > > > > of a second accuracy I mentioned)?
    > > > >
    > > > > And if storage is an issue, then is there a
    > way to
    > > > use
    > > > > my PC(hard drive)?
    > > > >
    > > > > So I'm assuming that a Basic Stamp 2 is what I
    > > > would
    > > > > need for my project? Is there any thing else?
    > > > >
    > > > > Thanks
    > > > >
    > > > > Darren Harris
    > > > > Staten Island, New York.
    > > > >
    > > > > Searcher7@m...
    > > > >
    > > >
    > > >
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > >
    > >
    > > __________________________________________________
    > > Do You Yahoo!?
    > > Get email at your own domain with Yahoo! Mail.
    > > http://personal.mail.yahoo.com/
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 21:41
    At 01:27 PM 4/12/01 -0700, you wrote:


    One word....


    DEBOUNCE


    > >"This is just an idea to conserve memory...>
    > >1)But the same "NIBBLE" will not occur on
    >consecutive>commands.
    >
    >"In the time the BS2 or PIC can "read" the four
    >switches,YES, it could..."
    >
    >Actually, since the input is completely manual, I know
    >that my joystick movements cannot occur that close
    >together, and never in the same direction twice in a
    >row(unless you are somehow talking about "open" and
    >"Close" on the same pin being considered the same
    >command).
    >
    >"> In the time the BS2 or PIC can "read" the four
    > > switches,
    > > YES, it could..."
    >
    >If it takes that long, then the stamp would be useless
    >to me.




    Beau Schwabe IC Mask Designer
    National Semiconductor Network Products Division
    500 Pinnacle Court, Suite 525 Mail Stop GA1 Norcross, GA 30071
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-12 22:46
    I assume that after a command it wouldn't be a problem
    to program the microcontroller not to accept the same
    command for the next second or so. Or I can just
    program it not to accept the same command again until
    one of the other 6 out of 8 commands were given
    first.(The 7th command I left out would of course be
    the release for the initial command).

    Thanks.

    Darren Harris
    Staten Island, New York.
    ********************************************************************************\
    ********************************************************************************\
    *****
    Searcher7@m...
    --- Beau Schwabe <bschwabe@a...> wrote:
    > At 01:27 PM 4/12/01 -0700, you wrote:
    >
    >
    > One word....
    >
    >
    > DEBOUNCE
    >
    >
    > > >"This is just an idea to conserve memory...>
    > > >1)But the same "NIBBLE" will not occur on
    > >consecutive>commands.
    > >
    > >"In the time the BS2 or PIC can "read" the four
    > >switches,YES, it could..."
    > >
    > >Actually, since the input is completely manual, I
    > know
    > >that my joystick movements cannot occur that close
    > >together, and never in the same direction twice in
    > a
    > >row(unless you are somehow talking about "open" and
    > >"Close" on the same pin being considered the same
    > >command).
    > >
    > >"> In the time the BS2 or PIC can "read" the four
    > > > switches,
    > > > YES, it could..."
    > >
    > >If it takes that long, then the stamp would be
    > useless
    > >to me.
    >
    >
    >
    >
    > Beau Schwabe IC Mask Designer
    > National Semiconductor Network Products
    > Division
    > 500 Pinnacle Court, Suite 525 Mail Stop GA1
    > Norcross, GA 30071
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get email at your own domain with Yahoo! Mail.
    http://personal.mail.yahoo.com/
Sign In or Register to comment.