Wiring Forum
http://wiring.org.co/cgi-bin/yabb/YaBB.pl
Suggestions >> Software Suggestions >> How about a micros() function?
http://wiring.org.co/cgi-bin/yabb/YaBB.pl?num=1154330383

Message started by justy on 07/31/06 at 07:19:42

Title: How about a micros() function?
Post by justy on 07/31/06 at 07:19:42
How about a micros() function that would return the number of microseconds since the board was reset?

-Justy

Title: Re: How about a micros() function?
Post by Forum Admin on 07/31/06 at 20:22:18
What would you like to do with this function? I was refreshing a screen once, and seemed interesting to have such a function, but I am curious on your application for it.

Title: Re: How about a micros() function?
Post by justy on 08/03/06 at 08:10:10
I'm developing a simple IR communications protocol.  I'm using the millis() function to see how much time has elapsed inbetween pulses.  If I had a micros() function, I could make it run up to 1000 times faster.   8-)

Title: Re: How about a micros() function?
Post by barragan on 08/03/06 at 20:49:53
have you found an alternative way of doing it?

Title: Re: How about a micros() function?
Post by justy on 08/04/06 at 08:54:07
I'm using millis(), but of course the smallest period of time I can check has elapsed is 1 millisecond.  It'll be OK for what I'm doing, as I only need to send 5-10 bytes.

I looked through the source for the core Wiring library, but only found a .h file.  Is it possible to use .cpp so that I can hack my own?  I'd be happy to share any results/success with the Wiring community.  Speaking of which, when I get my IR livrary working, I'll share that.

Title: Re: How about a micros() function?
Post by barragan on 08/04/06 at 19:57:50
That's very cool, check out this library template: http://wiring.org.co/cgi-bin/yabb/YaBB.pl?board=Library_writers

Title: Re: How about a micros() function?
Post by justy on 08/07/06 at 03:19:15
Yep, I've seen it, and it's really opened things up for me.  I use it even just to hide certain lower level functions to keep the Wiring code neat.  I was pleased when I could just paste in code from Wiring, add an entry in the .h, and away I went!

Title: Re: How about a micros() function?
Post by tylerfurtwangler on 12/03/06 at 07:05:40
I too would like to know if this is a possibility.  Ive began writing my own library, however i dotn know how to access some of the microcontroller specific details.  I imagine a microsecond function would be easy to write if i could figure out the current clock cycle / freq. of the controller.  is there any resources available for me to look at to write my own libraries?

Title: Re: How about a micros() function?
Post by barragan on 12/03/06 at 07:42:50
hi, yes there are some notes here: http://wiring.org.co/cgi-bin/yabb/YaBB.pl?board=Library_writers also the source code is available here http://wcvs.uniandes.edu.co

best,

Title: Re: How about a micros() function?
Post by tylerfurtwangler on 12/03/06 at 08:32:44
ah yes, thank you so much. exactly what i need :D  

Title: Re: How about a micros() function?
Post by barragan on 12/03/06 at 08:39:22
some more info here: http://wiring.org.co/faq.html#060 :)

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.