It is currently Wed Jul 06, 2011 1:58 pm

All times are UTC - 8 hours




 Page 1 of 1 [ 3 posts ] 
Author Message
 Post subject: falling box using timer source
PostPosted: Wed Mar 02, 2011 9:49 pm 

Joined: Sun Feb 27, 2011 8:32 pm
Posts: 138
Location: Where ever the USAF sends me.
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?



_________________
Page ID: KTS
Offline
 Profile  
 
 Post subject: Re: falling box using timer source
PostPosted: Wed Mar 02, 2011 9:54 pm 

Joined: Mon Feb 21, 2011 10:03 am
Posts: 26
Location: San Diego, CA
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);


Offline
 Profile  
 
 Post subject: Re: falling box using timer source
PostPosted: Thu Mar 03, 2011 9:58 am 

Joined: Sun Feb 27, 2011 8:32 pm
Posts: 138
Location: Where ever the USAF sends me.
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 ID: KTS
Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: