에서 일하고 있어요 :
static int
get_light(void)
{
return 10 * light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC)/7;
}
static int
get_temp(void)
{
return ((sht11_sensor.value(SHT11_SENSOR_TEMP)/10) - 396)/10;
}
는 예를 들어, 이들 센서의 값을 나타내 최소 애플리케이션 것이다 :
#include "contiki.h"
#include "dev/sht11-sensor.h"
#include "dev/light-sensor.h"
#include "dev/leds.h"
#include <stdio.h>
//Declare the process
PROCESS(send_sensor_info_process, "Print the Sensors Information");
//Make the process start when the module is loaded
AUTOSTART_PROCESSES(&send_sensor_info_process);
/*---------------------------------------------------------------------------*/
static int
get_light(void)
{
return 10 * light_sensor.value(LIGHT_SENSOR_PHOTOSYNTHETIC)/7;
}
/*---------------------------------------------------------------------------*/
static int
get_temp(void)
{
return ((sht11_sensor.value(SHT11_SENSOR_TEMP)/10) - 396)/10;
}
/*---------------------------------------------------------------------------*/
//Define the process code
PROCESS_THREAD(send_sensor_info_process, ev, data)
{
PROCESS_BEGIN();
SENSORS_ACTIVATE(light_sensor);
SENSORS_ACTIVATE(sht11_sensor);
printf("Light: %d \n", get_light());
printf("Temperature: %d \n", get_temp());
PROCESS_END();
}
'10 * light_sensor.value (LIGHT_SENSOR_PHOTOSYNTHETIC)/7'과'((sht11_sensor.value (SHT11_SENSOR_TEMP)/10) - 396)/10'을 설명 할 수 있습니까? – watou
TelosB mote에서 사용할 수있는 센서의 데이터 시트에서이 수식을 얻을 수 있습니다. 온도 센서는 [SHT11 센서] (http://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/Humidity/Sensirion_Humidity_SHT1x_Datasheet_V5.pdf)입니다. 체크 아웃하면 온도 센서가 센서로 온도를 계산하는 방법을 설명하는 수식 : 'T = d1 + d2 * sensorReading' 데이터 시트에있는 표에서 d1 및 d2의 값을 얻을 수 있습니다. 광 센서의 공식은 해당 센서 사양에서 얻을 수 있습니다. – PabloCorbalan