TempData = (double)(((data_high & 0x007F) << 8) + data_low) ĭelay(1000) // wait a second before printing again This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte. This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for tempsĭouble tempFactor = 0.02 // 0.02 degrees per LSB (measurement resolution of the MLX90614)ĭouble tempData = 0x0000 // zero out the data PORTC = (1 << PORTC4) | (1 << PORTC5) //enable pullupsĭata_low = i2c_readAck() //Read 1 byte and then send ackĭata_high = i2c_readAck() //Read 1 byte and then send ack The code for working with arduino Base is here: #include I have one IR Thermal Sensor (mlx90614 with this datasheet)īased on datasheet communication with sensor is in this way:
0 Comments
Leave a Reply. |