Skip to content

NTC B57164

Alex Krieg edited this page May 25, 2018 · 6 revisions

Hardware


Functions

  • B57164NTC(byte pin);
  • ~B57164NTC();
  • void update();
  • void read();
  • float temperature();
  • void onHigherThan(float temperature,void (*p_func)(float));
  • void onLowerThan(float temperature,void (*p_func)(float));


B57164NTC(byte pin);

Description

  • Constructor
  • Needs the analog input pin on which the sensor is connected to.

Syntax

B57164NTC myTempSensor(A0);
Temperature myTempSensor(A0);


~B57164NTC();

Description

  • Destructor

Syntax

delete &myTempSensor;


void update();

Description

  • Reads the sensor value.
  • Triggeres the events

Syntax

myTempSensor.update();


void read();

Description

  • Reads the sensor.
  • Included in .update().

Syntax

myTempSensor.read();


float temperature();

Description

  • Returns the temperature in °C.

Syntax

float temperature = myTempSensor.temperature();


Events

You do not know how events work?
Look over here

void onHigherThan(float temperature,void (*p_func)(float));

  • Is executed when the temperature is higher than temperature.
  • ONE value accepted, The current temperature.
  • NO return values.

void onLowerThan(float temperature,void (*p_func)(float));

  • Is executed when the temperature is lower than temperature.
  • ONE value accepted, The current temperature.
  • NO return values.