本帖最后由 desword 于 2016-12-15 16:31 编辑
这个问题我在tinyos-help里面也问了一下,但是这个论坛很不活跃,所以来这里请教大家了。
Currently, I am intending to record the cca and sfd value using a timer.
Due to the high frequency sampling rate (5ms/ sample), the output of the printf would flush themselves like follows:
[26804][26820]cca:1, sfd:0.
[26823][26831]cca:1, sfd:0.
[26834]cca:1, sfd:0.
[26841]cca:1, [26847]cca:0, sfd:0.
[26853][26868]cca:0, sfd:1.
[26876][26895]cca:1, sfd:0.
[26898][26914]cca:1, sfd:0.
[26917]cca:1, sfd:0.
[26924]cca:1, [26928]cca:1, sfd:0.
[26934][26938]cca:1, sfd:0.
[26946][26965]cca:1, sfd:0.
[26968][26985]cca:1, sfd:0.
[26988][26994]cca:1, sfd:0.
[26998][27014]cca:1, sfd:0.
[27020]cca:1, sfd:0.
[27027]cca:1, [27036]cca:1, sfd:0.
[27040][27055]cca:1, sfd:0.
[27058][27074]cca:0, sfd:0.
[27077][27084]cca:0, sfd:0.
[27087]cca:0, sfd:0.
[27097]cca:1, [27100]cca:1, sfd:0.
[27107][27116]cca:1, sfd:0.
[27119][27135]cca:1, sfd:0.
However, the correct format of output data should be "[time]cca:x, sfd:x". like follows:
[269842]cca:0, sfd:0.
[269859]cca:1, sfd:0.
[269872]cca:1, sfd:0.
[269887]cca:0, sfd:1.
[269905]cca:0, sfd:0.
[269918]cca:0, sfd:0.
[269932]cca:1, sfd:0.
[269947]cca:0, sfd:0.
[269962]cca:0, sfd:0.
[269977]cca:0, sfd:0.
[269992]cca:1, sfd:0.
[270007]cca:0, sfd:0.
[270024]cca:0, sfd:0.
[270038]cca:1, sfd:0.
[270053]cca:0, sfd:0.
[270067]cca:0, sfd:0.
[270082]cca:1, sfd:0.
So how to achieve the high rate sampling and recording with intended data format? My code is based on the TestNetworkLplC.nc, and I just add the periodic sampling timer as follows.