Shop OBEX P1 Docs P2 Docs Learn Events
Multi-tasking problem?: and what about javelin ? — Parallax Forums

Multi-tasking problem?: and what about javelin ?

ArchiverArchiver Posts: 46,084
edited 2003-12-13 18:26 in General Discussion
And what about javelin ?
Somebody knows something a bout multi-tasking
and the javelin stamp?

Thanks: Joe
PS: Are them difficult to be programble?


>
> --- Jon Williams <jwilliams@p...> wrote:
> > Oops... made a mistake. This is better, and I
> added
> > comments.
> >
> > Main:
> > DO
> > FOR idx = 0 TO 4 ' loop through channels
> > IF (timer(idx) = 0) THEN ' if timer
> expired,
> > check sensor
> >
> > IF (sensor(idx) = IsOn) THEN ' sensor
> > active?
> > timer(idx) = TimeDelay ' -- yes, load
> > timer
> > light(idx) = IsOn ' -- yes, turn on
> > light
> > ELSE
> > light(idx) = IsOff ' timer expired,
> kill
> > light output
> > ENDIF
> > ELSE
> > timer(idx) - timer(idx) - 1 ' update this
> > timer
> > ENDIF
> > NEXT
> > PAUSE LoopDelay
> > LOOP
> > END
> >
> >
> >
Original Message
> > From: Jon Williams
> > Sent: Friday, December 12, 2003 10:24 AM
> > To: basicstamps@yahoogroups.com
> > Subject: RE: [noparse][[/noparse]basicstamps] Multi-tasking problem?:
> > need to turn on the
> > lights for 10 seconds while ...
> >
> >
> > This is off the top of my head...
> >
> > Main:
> > DO
> > FOR idx = 0 TO 4
> > IF (timer(idx) = 0) THEN
> > IF (sensor(idx) = IsOn) THEN
> > timer(idx) = TimeDelay
> > light(idx) = IsOn
> > ELSE
> > light(idx) = IsOff
> > ENDIF
> > ELSE
> > timer(idx) = 0
> > ENDIF
> > NEXT
> > PAUSE LoopDelay
> > LOOP
> > END
> >
> > The ideas is to use a small loop delay value (say
> > 100 ms) and run it
> > multiple times (the value of TimeDelay) to create
> > your long pauses.
> >
> > -- Jon Williams
> > -- Applications Engineer, Parallax
> > -- Dallas Office
> >
> >
> >
> >
Original Message
> > From: Joe Terk [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=ghDZkPBYwn4IlFXd2I5rKIaJHQAcSR3FpAtXR1xRKCbmJ8rTD6zSWWemvaxC5Do-q8t2gOevrcw]joeterk@y...[/url
> > Sent: Friday, December 12, 2003 10:06 AM
> > To: basicstamps@yahoogroups.com
> > Subject: [noparse][[/noparse]basicstamps] Multi-tasking problem?:
> need
> > to turn on the
> > lights for 10 seconds while ...
> >
> >
> > hi,
> >
> > I have 5 human detectors and
> > I need to turn on 5 110volts lights for differents
> > amounts of time (i.e. 10 seconds)
> >
> > But if I place a 10 seconds of pause
> > (i.e. pause 10000) for the first relay
> > to close the circuit for 10 seconds,
> > it will be impossible to detect human
> > using the other 4 sensors.
> >
> > Is it a multi-tasking problem ?.
> >
> > Any help is welcome thanks: Joe
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > New Yahoo! Photos - easier uploading and sharing.
> > http://photos.yahoo.com/
> >
> > 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.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please
> > report SPAM to
> > abuse@p....
> >
> >
> > 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.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
> >
> >
> > This message has been scanned by WebShield. Please
> > report SPAM to
> > abuse@p....
> >
> >
> > 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.
> >
> >
> > Your use of Yahoo! Groups is subject to
> > http://docs.yahoo.com/info/terms/
> >
> >
>
>
> __________________________________
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing.
> http://photos.yahoo.com/
>
> 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.
>
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-12-12 22:22
    The Javelin Stamp is single-threaded. It does, however, have background
    timers so the process defined below is a little easier to code with
    precision.

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Joe Terk [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=y3xvWJfgvQOYbpSKjsP4ly07xiBS6CfWaT_7ev0pajavR-RSqirxAUeE0ubYITwbPBk-Vh5kDhg]joeterk@y...[/url
    Sent: Friday, December 12, 2003 12:54 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Multi-tasking problem?: and what about javelin ?


    And what about javelin ?
    Somebody knows something a bout multi-tasking
    and the javelin stamp?

    Thanks: Joe
    PS: Are them difficult to be programble?


    >
    > --- Jon Williams <jwilliams@p...> wrote:
    > > Oops... made a mistake. This is better, and I
    > added
    > > comments.
    > >
    > > Main:
    > > DO
    > > FOR idx = 0 TO 4 ' loop through
    channels
    > > IF (timer(idx) = 0) THEN ' if timer
    > expired,
    > > check sensor
    > >
    > > IF (sensor(idx) = IsOn) THEN ' sensor
    > > active?
    > > timer(idx) = TimeDelay ' -- yes, load
    > > timer
    > > light(idx) = IsOn ' -- yes, turn
    on
    > > light
    > > ELSE
    > > light(idx) = IsOff ' timer expired,
    > kill
    > > light output
    > > ENDIF
    > > ELSE
    > > timer(idx) - timer(idx) - 1 ' update this
    > > timer
    > > ENDIF
    > > NEXT
    > > PAUSE LoopDelay
    > > LOOP
    > > END
    > >
    > >
    > >
    Original Message
    > > From: Jon Williams
    > > Sent: Friday, December 12, 2003 10:24 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: RE: [noparse][[/noparse]basicstamps] Multi-tasking problem?:
    > > need to turn on the
    > > lights for 10 seconds while ...
    > >
    > >
    > > This is off the top of my head...
    > >
    > > Main:
    > > DO
    > > FOR idx = 0 TO 4
    > > IF (timer(idx) = 0) THEN
    > > IF (sensor(idx) = IsOn) THEN
    > > timer(idx) = TimeDelay
    > > light(idx) = IsOn
    > > ELSE
    > > light(idx) = IsOff
    > > ENDIF
    > > ELSE
    > > timer(idx) = 0
    > > ENDIF
    > > NEXT
    > > PAUSE LoopDelay
    > > LOOP
    > > END
    > >
    > > The ideas is to use a small loop delay value (say
    > > 100 ms) and run it
    > > multiple times (the value of TimeDelay) to create
    > > your long pauses.
    > >
    > > -- Jon Williams
    > > -- Applications Engineer, Parallax
    > > -- Dallas Office
    > >
    > >
    > >
    > >
    Original Message
    > > From: Joe Terk [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=y3xvWJfgvQOYbpSKjsP4ly07xiBS6CfWaT_7ev0pajavR-RSqirxAUeE0ubYITwbPBk-Vh5kDhg]joeterk@y...[/url
    > > Sent: Friday, December 12, 2003 10:06 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] Multi-tasking problem?:
    > need
    > > to turn on the
    > > lights for 10 seconds while ...
    > >
    > >
    > > hi,
    > >
    > > I have 5 human detectors and
    > > I need to turn on 5 110volts lights for differents
    > > amounts of time (i.e. 10 seconds)
    > >
    > > But if I place a 10 seconds of pause
    > > (i.e. pause 10000) for the first relay
    > > to close the circuit for 10 seconds,
    > > it will be impossible to detect human
    > > using the other 4 sensors.
    > >
    > > Is it a multi-tasking problem ?.
    > >
    > > Any help is welcome thanks: Joe
    > >
    > >
    > >
    > > __________________________________
    > > Do you Yahoo!?
    > > New Yahoo! Photos - easier uploading and sharing.
    > > http://photos.yahoo.com/
    > >
    > > 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.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    > >
    > > This message has been scanned by WebShield. Please
    > > report SPAM to
    > > abuse@p....
    > >
    > >
    > > 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.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    > >
    > > This message has been scanned by WebShield. Please
    > > report SPAM to
    > > abuse@p....
    > >
    > >
    > > 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.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > New Yahoo! Photos - easier uploading and sharing.
    > http://photos.yahoo.com/
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________
    Do you Yahoo!?
    New Yahoo! Photos - easier uploading and sharing.
    http://photos.yahoo.com/

    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.


    Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/




    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
  • ArchiverArchiver Posts: 46,084
    edited 2003-12-13 18:26
    While the Javelin is not strictly multi-tasking,
    it does implement the Ubicom SX28-ish 'pseudo peripherals'.
    These are UARTS, Timers, etc implemented 'inside'
    an interrupt service routine. Thus you get a
    UART that 'looks' like it's asynchronous, filling
    a buffer, which your JAVA code can access when
    it wants to.


    --- In basicstamps@yahoogroups.com, Joe Terk <joeterk@y...> wrote:
    > And what about javelin ?
    > Somebody knows something a bout multi-tasking
    > and the javelin stamp?
    >
    > Thanks: Joe
    > PS: Are them difficult to be programble?
    >
    >
    > >
    > > --- Jon Williams <jwilliams@p...> wrote:
    > > > Oops... made a mistake. This is better, and I
    > > added
    > > > comments.
    > > >
    > > > Main:
    > > > DO
    > > > FOR idx = 0 TO 4 ' loop
    through channels
    > > > IF (timer(idx) = 0) THEN ' if timer
    > > expired,
    > > > check sensor
    > > >
    > > > IF (sensor(idx) = IsOn) THEN ' sensor
    > > > active?
    > > > timer(idx) = TimeDelay ' -- yes, load
    > > > timer
    > > > light(idx) = IsOn ' -- yes,
    turn on
    > > > light
    > > > ELSE
    > > > light(idx) = IsOff ' timer
    expired,
    > > kill
    > > > light output
    > > > ENDIF
    > > > ELSE
    > > > timer(idx) - timer(idx) - 1 ' update this
    > > > timer
    > > > ENDIF
    > > > NEXT
    > > > PAUSE LoopDelay
    > > > LOOP
    > > > END
    > > >
    > > >
    > > >
    Original Message
    > > > From: Jon Williams
    > > > Sent: Friday, December 12, 2003 10:24 AM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: RE: [noparse][[/noparse]basicstamps] Multi-tasking problem?:
    > > > need to turn on the
    > > > lights for 10 seconds while ...
    > > >
    > > >
    > > > This is off the top of my head...
    > > >
    > > > Main:
    > > > DO
    > > > FOR idx = 0 TO 4
    > > > IF (timer(idx) = 0) THEN
    > > > IF (sensor(idx) = IsOn) THEN
    > > > timer(idx) = TimeDelay
    > > > light(idx) = IsOn
    > > > ELSE
    > > > light(idx) = IsOff
    > > > ENDIF
    > > > ELSE
    > > > timer(idx) = 0
    > > > ENDIF
    > > > NEXT
    > > > PAUSE LoopDelay
    > > > LOOP
    > > > END
    > > >
    > > > The ideas is to use a small loop delay value (say
    > > > 100 ms) and run it
    > > > multiple times (the value of TimeDelay) to create
    > > > your long pauses.
    > > >
    > > > -- Jon Williams
    > > > -- Applications Engineer, Parallax
    > > > -- Dallas Office
    > > >
    > > >
    > > >
    > > >
    Original Message
    > > > From: Joe Terk [noparse][[/noparse]mailto:joeterk@y...]
    > > > Sent: Friday, December 12, 2003 10:06 AM
    > > > To: basicstamps@yahoogroups.com
    > > > Subject: [noparse][[/noparse]basicstamps] Multi-tasking problem?:
    > > need
    > > > to turn on the
    > > > lights for 10 seconds while ...
    > > >
    > > >
    > > > hi,
    > > >
    > > > I have 5 human detectors and
    > > > I need to turn on 5 110volts lights for differents
    > > > amounts of time (i.e. 10 seconds)
    > > >
    > > > But if I place a 10 seconds of pause
    > > > (i.e. pause 10000) for the first relay
    > > > to close the circuit for 10 seconds,
    > > > it will be impossible to detect human
    > > > using the other 4 sensors.
    > > >
    > > > Is it a multi-tasking problem ?.
    > > >
    > > > Any help is welcome thanks: Joe
    > > >
    > > >
    > > >
    > > > __________________________________
    > > > Do you Yahoo!?
    > > > New Yahoo! Photos - easier uploading and sharing.
    > > > http://photos.yahoo.com/
    > > >
    > > > 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.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > > >
    > > >
    > > > This message has been scanned by WebShield. Please
    > > > report SPAM to
    > > > abuse@p...
    > > >
    > > >
    > > > 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.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > > >
    > > >
    > > > This message has been scanned by WebShield. Please
    > > > report SPAM to
    > > > abuse@p...
    > > >
    > > >
    > > > 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.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    > > >
    > >
    > >
    > > __________________________________
    > > Do you Yahoo!?
    > > New Yahoo! Photos - easier uploading and sharing.
    > > http://photos.yahoo.com/
    > >
    > > 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.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > New Yahoo! Photos - easier uploading and sharing.
    > http://photos.yahoo.com/
Sign In or Register to comment.