From: Nathael Pajani Date: Tue, 13 Sep 2016 16:20:20 +0000 (+0200) Subject: Update comments Use the TMP101 sensor adress as used on the exanh sensor board. X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=7c5728452705e6920f50b044f70316ab7aca3ac7;p=soft%2Flpc82x%2Fexamples Update comments Use the TMP101 sensor adress as used on the exanh sensor board. --- diff --git a/i2c_temp/main.c b/i2c_temp/main.c index 3db7519..c1e0080 100644 --- a/i2c_temp/main.c +++ b/i2c_temp/main.c @@ -57,19 +57,18 @@ const struct pio_config common_pins[] = { ARRAY_LAST_PIO, }; -#define TMP101_ADDR 0x90 /* Pin Addr0 (pin5 of tmp101) connected to GND */ + + +/***************************************************************************** */ +/* Temperature */ + +#define TMP101_ADDR 0x94 /* Pin Addr0 (pin5 of tmp101) connected to VCC */ struct tmp101_sensor_config tmp101_sensor = { .bus_num = I2C0, .addr = TMP101_ADDR, .resolution = TMP_RES_ELEVEN_BITS, }; - - -/***************************************************************************** */ -/* Temperature */ -/* The Temperature Alert pin is on GPIO Port 0, pin 7 (PIO0_7) */ -/* The I2C Temperature sensor is at address 0x94 */ void temp_config(int uart_num) { int ret = 0; @@ -134,11 +133,11 @@ int main(void) i2c_on(I2C0, I2C_CLK_100KHz, I2C_MASTER); - /* Configure onboard temp sensor */ + /* Configure temp sensor */ temp_config(UART0); + msleep(1); while (1) { - /* I2C Test using TMP101 temperature sensor */ temp_display(UART0); } return 0;