我是新手第一次寫
怎麼宣告及讀取温度呢
宣告如下
enum Sensors_Types
{
REFERENCE_ADC1_SENSOR = 0x01,
THERMISTOR_ADC2_SENSOR = 0x02,
ADC0_SENSOR = 0x04,
INTERNAL_SENSOR = 0x08,
DIGITAL_SENSOR1 = 0x10,
DIGITAL_SENSOR2 = 0x20,
DIGITAL_SENSOR3 = 0x40
};
void DigitalSensorInit()
{
//ROM sets P1OUT = 0x0F, this then consumes some current
P1OUT = 0x00; // needed to reduce power consumption on RF430FRL152H EVM, since P1.3 is connected to a 2.2K Ohm resistor on the EVM to ground
P1DIR &= ~MASTER_SLAVE_SELECT; // check if digital sensor mode is selected
if (P1IN & MASTER_SLAVE_SELECT)
{
//P1DIR &= ~MASTER_SLAVE_SELECT; //host controller mode selected, exit
return;
}
return;
}
不知道語法對不對,各位指導 一下新手
|