Shop OBEX P1 Docs P2 Docs Learn Events
Event Counting — Parallax Forums

Event Counting

DataJDataJ Posts: 23
edited 2009-04-24 23:53 in BASIC Stamp
We have been working on an HO Switching Display which has a mainline,·three turnouts leading to two sidings, and 5 IR Detector/Receiver combinations.· Direction control is handled by an·"H" Bridge.

It seems to me that the key issue to controlling the operation is·by counting the events.· (As each
event increments·this would step the program to the next sub-routine or branch.)

I·have been through all the Parallax publications and located "Counting Events" on page 105 of the
Stamp Works Manual and this appears to be the general idea.

I have attached the code I have written so far, but·the Stamp runs so fast that·counts occur so
quickly that the·program is completed for anything begins.

Any resource information or link would be appreciated.

Thank you,

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-04-24 21:17
    Uncommented code with meaningless variable names is the bane of programming! What exactly are you trying to do?

    You can always slow down your program by putting in pause statements.
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-04-24 21:50
    I agree with SRLM - uncommented code is difficult to evaluate.

    Also·brush up on definition, usage and syntax of subroutines.

    PS I prefer Z scale.

    Cheers Vaclav

  • DataJDataJ Posts: 23
    edited 2009-04-24 23:53
    Thank you for the replies - - let me update all this, create a track schmatic, starting point, and the test program that gets this thing to run from one end to the other and proceed from there.

    PS.· I also have an N-scale set up for Christmas - - I can't see it!! - - Z Scale is microscopic, but I like the space required.

    Unfornately, all·this small stuff, whether trains or RC aircraft needs better sight than I have now........
    Jim
Sign In or Register to comment.