My application is as follows:
Timer Dio0 Dio1
0 HIGH Low
1 HIGH HIGH
2 LOW HIGH
3 LOW LOW
Delay between timers is 5000ms.(ie., Timer0.start(TIMER_ONE_SHOT,5000),
Timer1.start(TIMER_ONE_SHOT,5000), Timer2.start(TIMER_ONE_SHOT,5000),
Timer3.start(TIMER_ONE_SHOT,5000)) If I use TIMER_ONE_SHOT means I am
getting required output. But the whole process is not repeating. For
repeating the whole process, if I go for TIMER_REPEAT option I am not
getting required output. Thats why I went for While loop. Is there any other
option to achieve my output
On Tue, Sep 2, 2008 at 2:04 PM, Marco Antonio Lopez Trinidad <
[EMAIL PROTECTED]> wrote:
> The question is why you use a loop instead a micro-controller timer to set
> and
> unset those outputs?
>
> --marco.
>
> > Thanks for your immediate reply. In my application I am using 2 dio
> pins.
> > At 1 sec, 1st Dio pin should me made high. After 5 sec, 2nd dio pin
> should
> > be high. then for next 5 sec, first dio pin should be low. Then for next
> 5
> > sec 2nd dio pin should be low. This process should be repeated
> continuously.
> > For continuity of this process i am using while loop. but this process is
> > executing only once. What code should I need to correct for my
> application.
> >
> > Thanks & Regards,
> > G.Dhivya
> >
> > On Tue, Sep 2, 2008 at 1:08 PM, Eric Decker <[EMAIL PROTECTED]> wrote:
> >
> > > what are you trying to do with the while loop?
> > >
> > > What the code will do is will start up the timers 10 times. But each
> time
> > > the given timer will be restarted but that is all.
> > >
> > > in other words the while loo does nothing.
> > >
> > > eric
> > >
> > > On Mon, Sep 1, 2008 at 11:55 PM, Dhivya G <[EMAIL PROTECTED]> wrote:
> > >
> > >>
> > >> Hi,
> > >> My application is to enable the Dio pins of MDA320 board at
> different
> > >> timer intervals. My code is as follows:
> > >>
> > >> command result_t StdControl.init() {
> > >> call Leds.init();
> > >> call DioControl.init();
> > >> return SUCCESS;
> > >> }
> > >> command result_t StdControl.start() {
> > >> uint16_t i;
> > >> call DioControl.start();
> > >> i=0;
> > >> while(i<=10){
> > >> call Timer0.start(TIMER_ONE_SHOT, 1000);
> > >> call Timer1.start(TIMER_ONE_SHOT, 5000);
> > >> call Timer3.start(TIMER_ONE_SHOT, 10000);
> > >> call Timer4.start(TIMER_ONE_SHOT, 15000);
> > >> i++;
> > >> }
> > >> return SUCCESS;
> > >> }
> > >> command result_t StdControl.stop() {
> > >> call DioControl.stop();
> > >> return SUCCESS;
> > >> }
> > >> event result_t Timer0.fired(){
> > >> call Dio2.high();
> > >> call Leds.greenToggle();
> > >> return SUCCESS;
> > >> }
> > >> event result_t Timer1.fired(){
> > >> call Dio3.high();
> > >> call Leds.yellowToggle();
> > >> return SUCCESS;
> > >> }
> > >> event result_t Timer3.fired(){
> > >> call Dio2.low();
> > >> call Leds.greenToggle();
> > >> return SUCCESS;
> > >> }
> > >> event result_t Timer4.fired(){
> > >> call Dio3.low();
> > >> call Leds.yellowToggle();
> > >> return SUCCESS;
> > >> }
> > >>
> > >> In this program While loop is executing only once. After that its not
> > >> repeating. can anyone help me to solve this problem.
> > >>
> > >> --
> > >> Thanks & regards,
> > >> G.Dhivya
> > >>
> > >> _______________________________________________
> > >> Tinyos-help mailing list
> > >> [email protected]
> > >>
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> > >>
> > >
> > >
> > >
> > > --
> > > Eric B. Decker
> > > Senior (over 50 :-) Researcher
> > > Autonomous Systems Lab
> > > Jack Baskin School of Engineering
> > > UCSC
> > >
> > >
> >
> >
> > --
> > G.Dhivya
> >
>
>
>
>
--
G.Dhivya
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help