Subversion Repositories HomeAutomation

Rev

Rev 2007 | Rev 2010 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 2007 Rev 2009
Line 41... Line 41...
41
        case 0:
41
        case 0:
42
            dht11_set_bus(DHT11_PIN_ch0);
42
            dht11_set_bus(DHT11_PIN_ch0);
43
            break;
43
            break;
44
        case 1:
44
        case 1:
45
            dht11_set_bus(DHT11_PIN_ch1);
45
            dht11_set_bus(DHT11_PIN_ch1);
-
 
46
            break;
-
 
47
        case 2:
-
 
48
            dht11_set_bus(DHT11_PIN_ch2);
-
 
49
            break;
-
 
50
        case 3:
-
 
51
            dht11_set_bus(DHT11_PIN_ch3);
-
 
52
            break;
-
 
53
        case 4:
-
 
54
            dht11_set_bus(DHT11_PIN_ch4);
-
 
55
            break;
-
 
56
        case 5:
-
 
57
            dht11_set_bus(DHT11_PIN_ch5);
46
            break;
58
            break;
47
    }
59
    }
48
#endif
60
#endif
49
 
61
 
50
    dht11_start();
62
    dht11_start();
Line 84... Line 96...
84
        txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_DHT11;
96
        txMsg.Header.ModuleType = CAN_MODULE_TYPE_SNS_DHT11;
85
        txMsg.Header.ModuleId = sns_DHT11_ID;
97
        txMsg.Header.ModuleId = sns_DHT11_ID;
86
        txMsg.Header.Command = CAN_MODULE_CMD_PHYSICAL_TEMPERATURE_CELSIUS;
98
        txMsg.Header.Command = CAN_MODULE_CMD_PHYSICAL_TEMPERATURE_CELSIUS;
87
        txMsg.Length = 3;
99
        txMsg.Length = 3;
88
 
100
 
89
        txMsg.Data[0] = 1;
101
        txMsg.Data[0] = sns_DHT11_currentSensor;
90
        temp = temperature[sns_DHT11_currentSensor]*64;
102
        temp = temperature[sns_DHT11_currentSensor]*64;
91
        txMsg.Data[1] = (uint8_t)(temp >> 8);
103
        txMsg.Data[1] = (uint8_t)(temp >> 8);
92
        txMsg.Data[2] = (uint8_t)(temp & 0xff);
104
        txMsg.Data[2] = (uint8_t)(temp & 0xff);
93
        while (StdCan_Put(&txMsg) != StdCan_Ret_OK);
105
        while (StdCan_Put(&txMsg) != StdCan_Ret_OK);
94
 
106