Question: In C++ Consider a Temperature Control Project, in which a microcontroller is used to communicate with a temperature sensor. The temperature sensor uses I-wire protocol

In C++ Consider a Temperature Control Project, in which a microcontroller is used to communicate with a temperature sensor. The temperature sensor uses I-wire protocol to send the temperature value represented in 16 bits binary format (one bit everyone second),

The procedure to read the temperature is performed as follows:

1. The Microcontroller sends the 8 bits READ TEMP command (10110011) to the sensor (one bit every one second).

2. When the READ_TEMP command is received by the sensor, it will keep the bus high (1) until the temperature data becomes available.

3. The Microcontroller must waits until the bus become low by the temperature sensor (i.e. temperature data is ready).

4. The Microcontroller starts to read the temperature, which is prepared by the sensor in 2 bytes

Write the C++ Program to print the temperature every 1 minute. Also it is required to display a warning message in the temperature is higher than 32 degree Celsius.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!