Line 6... |
Line 6... |
6 |
i2c_write(0x80); // Device address |
6 |
i2c_write(0x80); // Device address |
7 |
i2c_write(0xFE); // Device command |
7 |
i2c_write(0xFE); // Device command |
8 |
i2c_stop(); // Stop condition |
8 |
i2c_stop(); // Stop condition |
9 |
} |
9 |
} |
10 |
|
10 |
|
- |
|
11 |
SHT_ |
- |
|
12 |
|
11 |
unsigned int8 SHT25_setup() |
13 |
unsigned int8 SHT25_setup() |
12 |
{ |
14 |
{ |
13 |
unsigned int8 reg; |
15 |
unsigned int8 reg; |
14 |
|
16 |
|
15 |
i2c_start(); // Start condition |
17 |
i2c_start(); // Start condition |
16 |
i2c_write(0x80); // Device address |
18 |
i2c_write(0x80); // Device address |
17 |
i2c_write(0xE7); // Device command |
19 |
i2c_write(0xE7); // Device command |
18 |
// i2c_stop(); // Stop condition |
- |
|
19 |
|
20 |
|
20 |
i2c_start(); // Start condition |
21 |
i2c_start(); // Start condition |
21 |
i2c_write(0x81); // Device address |
22 |
i2c_write(0x81); // Device address |
22 |
reg=i2c_read(0); // Device command |
23 |
reg=i2c_read(0); // Device command |
23 |
i2c_stop(); // Stop condition |
24 |
i2c_stop(); // Stop condition |