forum.getinpulse.com
http://www.getinpulse.com/hack/forum/

falling box using timer source
http://www.getinpulse.com/hack/forum/viewtopic.php?f=7&t=72
Page 1 of 1

Author:  Killer Turtle [ Wed Mar 02, 2011 9:49 pm ]
Post subject:  falling box using timer source

Trying to do some stuff with this code just have one question that I can't seem to figure out since my c coding is very lacking, but I'm starting to learn.

how would I use the "void pulse_cancel_timer(int8_t * id)" coding to stop the timer?

Author:  Duane [ Wed Mar 02, 2011 9:54 pm ]
Post subject:  Re: falling box using timer source

When you set a timer, it returns an identifier, which you should store somewhere. When you want to cancel the timer, you pass a pointer to where you stored the identifier, and the function kills the timer and "clears" the identifier, ie:

// create the timer
int32_t my_timer = pulse_register_timer(1000, my_callback, NULL);

// cancel the timer
pulse_cancel_timer(&my_timer);

Author:  Killer Turtle [ Thu Mar 03, 2011 9:58 am ]
Post subject:  Re: falling box using timer source

OK thanks,
I'll give this a try tonight.
What I plan on doing is having the falling box program come up on a button click, then have the analog clock come up on another button click. This will give me some practice at some coding without having to first write a whole program. Then once this is done, I'll start on a more advanced program.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/