...
The 04-synchtemp
sample application showcases the network-wide synchronization of a
Include Page | ||||
---|---|---|---|---|
|
Load the 04-synctemp
sample application on multiple motes - wait for them to join the same network and they will begin to take temperature measurements in synchrony.
...
The sample application consists of a task which arms a timer, waits for it to expire, and blinks the blue LEDthen takes a temperature measurement and sends it to the manager.
It uses dn_getNetworkTime()
to retrieve the current network time, and arms the timer so it expires the next time the ASN counter is integer divisible by 256at the integer second closest to the reporting period. Since all nodes increment their ASN and UTC time at the same time, this event happens at the same time on all nodes in the network.
It also contains CLI commands for getting and setting the sample period, and supports setting the period over the air.