revised work

Dependents:   labbbbbb2

Embed: (wiki syntax)

« Back to documentation index

Labb2 Class Reference

Labb2 Class Reference

My Temperature Sensor class. More...

#include <Temperature.h>

Public Member Functions

float get_temp ()
 This function gets temperature in Celsius.
void power_sensor (int i)
 This function starts sensor with 1 and stops with 0.
float c_to_f (float celsius)
 This function converts temperature to Fahrenheit.

Detailed Description

My Temperature Sensor class.

Used for Reading Temperature from PCB.

Example:

 #include "mbed.h"
 #include "Temperature.h"

 int main()
 *{
  Labb2 temp;
  temp.power_sensor(1);
  while(1 == 1)
  {
      float a = temp.get_temp();
      printf("Temperatur i C: %.2f ", a);   
      printf("\n"); 
      float b = temp.c_to_f(a);
      printf("Temperatur i F: %.2f ", b);   
      printf("\n\n");
  }
 *}

Definition at line 29 of file Temperature.h.


Member Function Documentation

float c_to_f ( float  celsius )

This function converts temperature to Fahrenheit.

Definition at line 54 of file Temperature.cpp.

float get_temp (  )

This function gets temperature in Celsius.

Definition at line 9 of file Temperature.cpp.

void power_sensor ( int  i )

This function starts sensor with 1 and stops with 0.

Definition at line 38 of file Temperature.cpp.