telosb下用tinyos编写温度湿度光照程序怎么写啊?
如题,有人会tinyos吗?并编写温度湿度光照吗? telosb是用msp430作为主控芯片,在wsn中应用的相当广泛,小弟初学tinyos,还请各位大牛多多指教 event void readTemp.readDone(error_t result, uint16_t val) {if (result == SUCCESS){
printf("the local Temperature is :");
val = -39.60 + 0.01*val;
printf("%d C\n" ,val);
call Leds.led0Toggle();
}
}
event void readHumidity.readDone(error_t result, uint16_t val) {
if (result == SUCCESS){
printf("the local Humidity is :");
//val = -4 + 0.0405*val + (-2.8 * 10^-6)*(val^2);
printf("%d\n",val);
call Leds.led1Toggle();
}
}
event void readPhoto.readDone(error_t result, uint16_t val) {
printf("the photo is %d",val);
call Leds.led2Toggle();
}
具体可以看这个温度湿度的程序http://tinyos.uueasy.com/read-htm-tid-1.html
页:
[1]