Shop OBEX P1 Docs P2 Docs Learn Events
BS I time question — Parallax Forums

BS I time question

Jimbo30Jimbo30 Posts: 129
edited 2010-12-10 09:02 in BASIC Stamp
Just a general question about what the best option would be to keep track of...... say.....counting cups for 1 minute and after the 1 minute is up, debug the result with a BSI. Could this be done in the PBASIC code or would you need a circuit to keep track of the time? I read in the past that the basic stamp couldn't do this in the PBASIC code.

Comments

  • ercoerco Posts: 20,256
    edited 2010-12-09 01:00
    If you don't need ultra precision, a Stamp 1 can rough out a minute pretty closely if you code it properly. It doesn't have an onboard clock, so you have to estimate it using pauses and loops, calibrating it through trial & error. Not too hard.
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-12-09 09:20
    Thanks erco, but according to the syntax manual BSI doesn't allow DO LOOPS.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-09 10:03
    That's correct. You have to use IF/THEN and GOTO and labels. We're talking loops here, not DO/LOOPs
  • ercoerco Posts: 20,256
    edited 2010-12-09 10:24
    FOR/NEXT loops are your best friend with the BS1. Glad to hear you're using a BS1; a lot of people dismiss it and jump to something more complicated. In reality a BS1 is a very nice little processor and plenty versatile for many projects (counting cups...?). Its tiny EEPROM forces you to program efficiently; that's quickly becoming a lost art with the abundance of cheap memory on larger chips.
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-12-09 23:21
    Thanks guys. I was also thinking about using a 555 monostable timer circuit. I will check out both possibilities this weekend.
  • PeterHPeterH Posts: 21
    edited 2010-12-10 06:45
    Yes the BS! is a great little product, and the memory constraint is a fun challenge. I have used it for several projects. The BS1 project board is an incredible bargain: a ready to go system for just $30
  • ercoerco Posts: 20,256
    edited 2010-12-10 09:02
    @Peter H: Agreed. The BS1 project board was $14.95 originally for several YEARS. I stocked up and still regret not buying more!
Sign In or Register to comment.