Driver for TMP06 temperature sensor. Data is sent by PWM. Tested on Hani-IoT board with TMP06BRTZ sensor.

Example usage

main.cpp

#include "mbed.h"
#include "TMP06.h"

int main()
{
    TMP06 temp_sensor(P0_1);
    float temperature;

    while (true) {
        if(temp_sensor.read(&temperature) == SUCCESS) {
            printf("Temperature: %f\n", temperature);
        }
        else {
            printf("Error!\n");
        }

        ThisThread::sleep_for(2000);
    }
}

Tags

2020-03-03 tip Revision History Files