Measuring temperatures with TMP03/04 (Part 5)

Part 12345, 6, 7, 8

And here is an example of use of the library

/*

	PlainTEMP01_01.pde is an example of use of PlainTMP library,
	which reads temperatures from AD TMP03/04 and TMP05/06 sensors
	Copyright (C) 2010 Didier Longueville

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

/* Libraires */
#include  /* TMP0x sensors library */

PlainTMP TMP = PlainTMP(); /* Create an instance of the TMP object */

void setup() {
	Serial.begin(115200);
	Serial.print("Revision: ");
	Serial.println(TMP.revision(), DEC);
}

void loop() {
	Serial.print(TMP.temperature(TMP_TMP03, &PORTB, PINB0, TMP_UNI_KELVIN, 8), 2);
	Serial.print(" K, ");
	Serial.print(TMP.temperature(TMP_TMP03, &PORTB, PINB0, TMP_UNI_CELSIUS, 8), 2);
	Serial.print(" C, ");
	Serial.print(TMP.temperature(TMP_TMP03, &PORTB, PINB0, TMP_UNI_FAHRENHEIT, 8), 2);
	Serial.println(" F");
	delay(2000);
}

Please check this page if you are interested in the code.

2 Comments

  1. LeandroM says:

    Hey, the next part, 6, is not loading… appears “You are not allowed to edit this item.”

    greets

  2. Didier says:

    Done ! Thanks for the review and the kind notice 😉

Leave a Reply

You must be logged in to post a comment.