Shop OBEX P1 Docs P2 Docs Learn Events
NEWBIE :please be nice — Parallax Forums

NEWBIE :please be nice

ArchiverArchiver Posts: 46,084
edited 2004-04-21 19:30 in General Discussion
Hello all.. I am a newbie to stamps. I am and electronic technician.
and got an application in mind. COunting the closure of a
switch ...so i guess the question i am asking is .. is ths bs1
capable of counting and storing a number 1 to 999,999 ..rather large
number i know and also i need to store two of those big ones.. the
bs2 versions may be a better choice but i am also looking at cost..
i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want to
know if it is possible.. i beginning to read the manual so to speak.
and see a command called BUTTON My idead is to somehow store these
numbers and then maybe create some sort of infared receiver to
transmit these NUMBERS to a hanheld device... I presently work at a
job where i have to collect these numbers by hand a very time
consuming process.. from 78 machines.. each haveing two 6 to 7 digit
meters. ...Always searching for easer ways....cost per unit always
a factor if im going to sell the idea to the bosses...well wish me
luck in my little or maybe a big start in the world of stamps..MY
BIrthday coming up still trying to decide which to get. so i thought
this would be a good start...thanks for your time

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-20 06:50
    <snip>

    > is ths bs1 capable of counting and storing a number 1 to 999,999

    > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    to know if it is possible..



    The simple answer is YES, you can add up to extreemly large numbers.

    The answer is pretty simple, so I'll keep quite and let you figure it
    out.

    Dave
    (ps: if you want a hint, let us know you DON'T want an ANSWER, just a
    hint)
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-20 14:21
    If I were you, I'd start with the BS2 and the
    Board Of Education. This has enough horse-power
    to do a proof of concept. The IR transmission
    can be done with a pair of IR-Buddy units.

    Once you've proven it can be done, then you
    can try to fit your solution into a BS1. If
    it won't fit, there are other ways of using
    PIC processors in Basic, so your efforts won't
    be wasted.

    One way to save dollars would be to buy one of
    the BS2 OEM kits, and built it yourself. There's
    a special on right now.

    For 78 machines, you might try an RS485 'party'
    line approach. Be careful, though, that you
    don't engineer yourself out of a job. ;-)

    --- In basicstamps@yahoogroups.com, "wiltab94" <wiltab94@c...> wrote:
    > Hello all.. I am a newbie to stamps. I am and electronic
    technician.
    > and got an application in mind. COunting the closure of a
    > switch ...so i guess the question i am asking is .. is ths bs1
    > capable of counting and storing a number 1 to 999,999 ..rather
    large
    > number i know and also i need to store two of those big ones.. the
    > bs2 versions may be a better choice but i am also looking at cost..
    > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    to
    > know if it is possible.. i beginning to read the manual so to
    speak.
    > and see a command called BUTTON My idead is to somehow store these
    > numbers and then maybe create some sort of infared receiver to
    > transmit these NUMBERS to a hanheld device... I presently work at
    a
    > job where i have to collect these numbers by hand a very time
    > consuming process.. from 78 machines.. each haveing two 6 to 7
    digit
    > meters. ...Always searching for easer ways....cost per unit always
    > a factor if im going to sell the idea to the bosses...well wish me
    > luck in my little or maybe a big start in the world of stamps..MY
    > BIrthday coming up still trying to decide which to get. so i
    thought
    > this would be a good start...thanks for your time
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 02:14
    Thanks for the answer....i problally would like a hint....I KNOW thats
    cheating.. but .. hey thats what the internet for LOL
    Original Message
    From: "Dave Mucha" <davemucha@j...>
    To: <basicstamps@yahoogroups.com>
    Sent: Tuesday, April 20, 2004 12:50 AM
    Subject: [noparse][[/noparse]basicstamps] Re: NEWBIE [noparse]:p[/noparse]lease be nice


    > <snip>
    >
    > > is ths bs1 capable of counting and storing a number 1 to 999,999
    >
    > > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    > to know if it is possible..
    >
    >
    >
    > The simple answer is YES, you can add up to extreemly large numbers.
    >
    > The answer is pretty simple, so I'll keep quite and let you figure it
    > out.
    >
    > Dave
    > (ps: if you want a hint, let us know you DON'T want an ANSWER, just a
    > hint)
    >
    >
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 04:51
    Somebody please correct me if wrong....


    The largest number the Basic Stamp can store is 65535, one word
    (%1111111111111, or $FFFF which is 65535).

    Am I off base here?

    ken
    ==============================
    > is ths bs1 capable of counting and storing a number 1 to 999,999

    > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    to know if it is possible..



    The simple answer is YES, you can add up to extreemly large numbers.

    The answer is pretty simple, so I'll keep quite and let you figure it
    out.


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 05:20
    You are of course correct. What I should have stated is.......

    The largest value that can be sotred in a Basic Stamp variable is one word,
    or 16 bits...which comes out to......

    65535 decimal

    FFFF hexidecimal

    1111111111111111 binary

    ????? yes/no

    ken
    ========================
    Sort of. The largest number one decimal digit can store is 9. Then
    what?

    Steve

    On 20 Apr 04 at 23:51, smartdim@a... wrote:

    > Somebody please correct me if wrong....
    >
    >
    > The largest number the Basic Stamp can store is 65535, one word
    > (%1111111111111, or $FFFF which is 65535).
    >
    > Am I off base here?
    >
    > ken


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 05:24
    --- In basicstamps@yahoogroups.com, "willie howell" <wiltab94@c...>
    wrote:
    > Thanks for the answer....i problally would like a hint....I KNOW
    thats
    > cheating.. but .. hey thats what the internet for LOL


    ummm.... a hint, without giving up the whole thing.

    would the anology of an Abacus make sense ?

    Think of each bar as a 16 bit word
    each bead as a bit ?

    or, was that too simple ?

    Dave



    http://www.visualmuses.com/chipcircuit/index.html
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 06:05
    ken-

    Sort of. The largest number one decimal digit can store is 9. Then
    what?

    Steve

    On 20 Apr 04 at 23:51, smartdim@a... wrote:

    > Somebody please correct me if wrong....
    >
    >
    > The largest number the Basic Stamp can store is 65535, one word
    > (%1111111111111, or $FFFF which is 65535).
    >
    > Am I off base here?
    >
    > ken
    > ==============================
    > > is ths bs1 capable of counting and storing a number 1 to 999,999
    >
    > > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    > to know if it is possible..
    >
    >
    >
    > The simple answer is YES, you can add up to extreemly large numbers.
    >
    > The answer is pretty simple, so I'll keep quite and let you figure
    > it out.
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 07:04
    --- In basicstamps@yahoogroups.com, "S Parkis" <parkiss@e...> wrote:
    > ken-
    >
    > Sort of. The largest number one decimal digit can store is 9.
    Then
    > what?
    >
    > Steve


    Interesting, but the largest single digit number YOU can use is 9
    also. Seems my old IBM PC and my Pentium also has that same
    limitation.

    And, no it is not that there are 1 types of people, those that use
    binary and those who don't.

    The question is answered on what you do when you add a 1 to that 9.

    Dave
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 07:32
    --- In basicstamps@yahoogroups.com, smartdim@a... wrote:
    > You are of course correct. What I should have stated is.......
    >
    > The largest value that can be stored in a Basic Stamp variable is
    one word,
    > or 16 bits...which comes out to......
    >
    > 65535 decimal
    >
    > FFFF hexidecimal
    >
    > 1111111111111111 binary
    >
    > ????? yes/no
    >
    > ken


    You are correct that the largest number you can store in ONE word is
    65535.

    but, even though a transistor can only store a 1 or a 0, we do not
    limit the maximum number a computer can use as 1.

    Remember, the orgional poster is adding by 1 for some count of people
    or products. This is not for floating point math or even simple
    arithimic. Just incrementing a count by 1.

    I'd be interested to know how long it would take if one were to look
    at one pin, and monitor a square wave, just how long it would take
    for the Stamp to add up to a Googleplex ?

    I think it would take less than 30 WORDS to count to a Googleplex.

    I think we have gone way past a hint on this topic.

    Dave











    > ========================
    > Sort of. The largest number one decimal digit can store is 9.
    Then
    > what?
    >
    > Steve
    >
    > On 20 Apr 04 at 23:51, smartdim@a... wrote:
    >
    > > Somebody please correct me if wrong....
    > >
    > >
    > > The largest number the Basic Stamp can store is 65535, one word
    > > (%1111111111111, or $FFFF which is 65535).
    > >
    > > Am I off base here?
    > >
    > > ken
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 12:53
    hint; Count up to 50000 and set a variable to one. reset the counter and
    count up to 50000 and increment the variable by 1, etc. When you get the
    data out, the count * the variable is the count. This is just one way to
    increase the ability of an 8 bit processor to count higher than it's
    inherent capabilities. If you are dumping the count to a pc, it can do the
    multiplication for you in the readout routine. A reset on the stamp starts
    everything over again.
    jim
    http://www.geocities.com/jimforkin2003/


    Original Message
    From: smartdim@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=7ijLdzlZLaNRkRBHsx2VmJX03LjDgiy5Afh0VoST8tMjOYKkKYi-pcqkpR00Q0dl3gLH5eHTunD5]smartdim@a...[/url
    Sent: Tuesday, April 20, 2004 11:51 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Re: NEWBIE [noparse]:p[/noparse]lease be nice


    Somebody please correct me if wrong....


    The largest number the Basic Stamp can store is 65535, one word
    (%1111111111111, or $FFFF which is 65535).

    Am I off base here?

    ken
    ==============================
    > is ths bs1 capable of counting and storing a number 1 to 999,999

    > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    to know if it is possible..



    The simple answer is YES, you can add up to extreemly large numbers.

    The answer is pretty simple, so I'll keep quite and let you figure it
    out.


    [noparse][[/noparse]Non-text portions of this message have been removed]



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.

    Yahoo! Groups Links
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 15:42
    True, the largest primitive data type in the
    BS2 is the 'WORD', which is 16 bits. However,
    you can have 16 of these things, so if you use
    two of them, you can get
    LowWord VAR WORD
    HighWord VAR WORD

    LowWord and HighWord together are a 'long',
    (32-bit) value.

    For a 'counter':
    NextCount:
    LowWord = LowWord + 1
    IF LowWord = 0 THEN IncHighWord
    ' It would be 0, because it just rolled over
    ' from 65535 to 0.
    GOTO NextCount
    IncHighWord:
    HighWord = HighWord + 1
    GOTO NextCount

    --- In basicstamps@yahoogroups.com, smartdim@a... wrote:
    > Somebody please correct me if wrong....
    >
    >
    > The largest number the Basic Stamp can store is 65535, one word
    > (%1111111111111, or $FFFF which is 65535).
    >
    > Am I off base here?
    >
    > ken
    > ==============================
    > > is ths bs1 capable of counting and storing a number 1 to 999,999
    >
    > > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    > to know if it is possible..
    >
    >
    >
    > The simple answer is YES, you can add up to extreemly large numbers.
    >
    > The answer is pretty simple, so I'll keep quite and let you figure
    it
    > out.
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-21 19:30
    Here's a methodology:

    You can also use the highest bit as an implicit "carry" bit ; add to the
    variable any amount, and if the highest bit is set (you can test this , I
    belive, by testing whether var&f000 = f000) ; then add that bit to the
    second variable.

    something like (my syntax is probably bad):

    var0 = var0 + var0increment` or whatever you're adding

    var1 = var1 + (var0&f000)>>15 ` shift the high bit downwards & add

    var0 = var0 & (ffff - f000) ` clear carry bit - this could be 0fff

    ` at this point the 31-bit number should be var0*32768+var1


    One advantage to doing it this way is you can actually add numbers that
    are greater than 5000 ; making one small change to the above:

    var1 = var1 + var1increment + (var0&f000)>>15

    Then if you wanted to add, say, 100000 to the number, you could make

    var0increment=1696
    var1increment=3

    The total is 3*32768+1696, or 100,000.






    On Wed, 21 Apr 2004, Jim Forkin wrote:

    > hint; Count up to 50000 and set a variable to one. reset the counter and
    > count up to 50000 and increment the variable by 1, etc. When you get the
    > data out, the count * the variable is the count. This is just one way to
    > increase the ability of an 8 bit processor to count higher than it's
    > inherent capabilities. If you are dumping the count to a pc, it can do the
    > multiplication for you in the readout routine. A reset on the stamp starts
    > everything over again.
    > jim
    > http://www.geocities.com/jimforkin2003/
    >
    >
    >
    Original Message
    > From: smartdim@a... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=kj0gCe4uOypvnIbnNoa00pND-FKTJcmnUuvz3jwDWy12ucyt6SA26oG1Ycsz5Li9QeVodaYF]smartdim@a...[/url
    > Sent: Tuesday, April 20, 2004 11:51 PM
    > To: basicstamps@yahoogroups.com
    > Subject: Re: [noparse][[/noparse]basicstamps] Re: NEWBIE [noparse]:p[/noparse]lease be nice
    >
    >
    > Somebody please correct me if wrong....
    >
    >
    > The largest number the Basic Stamp can store is 65535, one word
    > (%1111111111111, or $FFFF which is 65535).
    >
    > Am I off base here?
    >
    > ken
    > ==============================
    > > is ths bs1 capable of counting and storing a number 1 to 999,999
    >
    > > i dont want to know how....(THAT WOULD SPOOL THE FUN) i just want
    > to know if it is possible..
    >
    >
    >
    > The simple answer is YES, you can add up to extreemly large numbers.
    >
    > The answer is pretty simple, so I'll keep quite and let you figure it
    > out.
    >
    >
    > [noparse][[/noparse]Non-text portions of this message have been removed]
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    > Body of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    > Yahoo! Groups Links
    >
    >
    >
    >
    >
    >

    Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc. (ServNet)
    Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma - Bremerton
    email: lamont@a... WWW: http://www.serv.net
    "Do not fear mistakes, There Are None" - Miles Davis
Sign In or Register to comment.