Hi,
I am using Iris mote and TinyOS-2.x, and trying to get local time in micro
seconds.
I put my code at the end of this mail, and my out put looks something like this:
1024 986787
2048 1908532
3072 2830276
4096 3752021
...
I looked through TEP102, and it says "one second contains 1024 binary
milliseconds, 32768 32kHz ticks, or 1048576 microseconds", but it seems that in
my case, microseconds only increases about 921745 for each 1024ms.
Is this what I'm supposed to get? or I'm doing something wrong?
Also, Is there any way to get microsec in uint64_t??
Best regards,
John
__PrintTimeAppC.nc__
configuration PrintTimeAppC{
}
implementation {
components MainC, PrintTimeC;
components LocalTimeMicroC;
components LocalTimeMilliC;
components new TimerMilliC() as Timer;
PrintTimeC.Boot -> MainC;
PrintTimeC.LocalMicro -> LocalTimeMicroC;
PrintTimeC.LocalTime -> LocalTimeMilliC;
PrintTimeC.Timer -> Timer;
}
__PrintTimeC.nc__
#include "printf.h"
#include "Timer.h"
#include "MicaTimer.h"
module PrintTimeC {
uses {
interface Boot;
interface LocalTime<TMicro> as LocalMicro;
interface LocalTime<TMilli> as LocalTime;
interface Timer<TMilli> as Timer;
}
}
implementation {
event void Boot.booted() {
call Timer.startPeriodic(1024);
}
event void Timer.fired() {
printf("%ld %ld\n", call LocalTime.get(), call LocalMicro.get());
printfflush();
}
}
__Makefile__
COMPONENT=PrintTimeAppC
CFLAGS += -I$(TOSDIR)/lib/printf
CFLAGS += -I$(TOSDIR)/lib/timer
CFLAGS += -I$(TOSDIR)/platforms/iris
include $(MAKERULES)
---------------------------------
GyaO! - Anime, Dramas, Movies, and Music videos [FREE]
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help