Shop OBEX P1 Docs P2 Docs Learn Events
BS1 question — Parallax Forums

BS1 question

Blackbird455Blackbird455 Posts: 124
edited 2009-03-19 02:39 in BASIC Stamp
Ok,

· Its been a year since I wrote any code, and I need some help stat!!!!!


· I want to make a BS1· run several lines of code then pause for 20 mins and run again, to no end.


· How?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Noli nothis permittere te terere

Comments

  • Blackbird455Blackbird455 Posts: 124
    edited 2009-03-07 21:07
    You know what? I just had an idea, I am only using one output, so I can bounce 60000 pauses between the other pins till I need my "hot" pin.

    There has to be a better way , right?



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Noli nothis permittere te terere
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-07 21:15
    You can PAUSE for 65535ms, one command max.
    If you PAUSE 60000·20 1200 20 times, that'll be 20min.
    FOR minutes = 0 to [color=red][s]1199[/s] 19  [/color][color=green]' 20X[/color]
    PAUSE 60000                 [color=green]' 1 minute[/color]
    NEXT
    
    

    [noparse][[/noparse]"Hot pin"? What's that all about?· No, wait, DON'T tell me.]

    Post Edit -- 1200 times

    Where've you been, anyway?

    Further Post Edit -- No, it's 20!· Let's see, 60000ms = 60sec = 1min.· So, minutes it should be, for 20 minutos the minutes VAR should be 19 (0 - 19 = 20X.)··Got the Verizon-Math guy's voice ringing in my head here.· Don't know why I panicked and multipled by 60 like that.· Terrible.· Sixty thousand milliseconds, dekaminutes, it's all too much.

    Post Edited (PJ Allen) : 3/8/2009 2:34:39 PM GMT
  • Blackbird455Blackbird455 Posts: 124
    edited 2009-03-07 22:30
    PJ, helpfull as always.......

    · Well lets see,

    · I am taking a BS1, ( b/c its the only chip that I have assembled currently) and making a trigger for a digital camera that is going upstairs in his house. I will have it take one pic every 60 seconds for the first few days.
    Once I establish a likely pattern from 1440 pics a day, I will concentrate the shutter action for the peak times. Taking as many as 15 pics a minute.

    Oh and the friends house has rear access that is secluded and so therefore I can access the camera without compromising my mission, so I can download it everyday.
    ·


    Post Edited By Moderator (Dave Andreae (Parallax)) : 3/10/2009 10:09:27 PM GMT
  • Mike2545Mike2545 Posts: 433
    edited 2009-03-08 05:22
    Blackbird455,
    are you a UFO hunter or coastguard?

    Nobody trying to wear you down here...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.

    Post Edited (Mike2545) : 3/8/2009 5:38:56 AM GMT
  • Blackbird455Blackbird455 Posts: 124
    edited 2009-03-08 11:09
    Neither.......what makes you ask that?

    (Former DCE/SP R.A.I.D. Crewchief)



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Noli nothis permittere te terere
  • luisr320luisr320 Posts: 3
    edited 2009-03-19 02:22
    Hi. I'm not an expert so bear with me.
    Try this:

    ' {$STAMP BS1}
    ' {$PBASIC 1.0}
    
    SYMBOL minutes = B1          ' number of minutes
    
    OUTPUT 0                           'Makes Pin 7 an Output pin the "hot" pin
    
    START:                              'Loop label
    
        HIGH 0                          'Set Pin 7 to HIGH, and take a photo
        PAUSE 700                    'Wait for 0.7 seconds just to be sure the camera button is pressed long enough
        LOW 0                          'Set Pin 7 to LOW
        FOR minutes = 1 to 20   ' 20X
           PAUSE 60000             ' 1 minute
        NEXT
       GOTO START                  'loop from Start
    
    END                                  'Not really necessary since the program will never leave the loop
    

    Post Edited (luisr320) : 3/19/2009 2:34:47 AM GMT
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-03-19 02:39
    You're digging up old Subjects.· It moved from here to

    here -- http://forums.parallax.com/showthread.php?p=790507
Sign In or Register to comment.