Utility

The components of the Utility library can be found below.

softwareReset

Description

Generate reset.

Syntax

void softwareReset()

Parameters

None

Returns

None

getResetFlag

Description

Get the matter of reset.

Syntax

uint8_t getResetFlag()

Parameters

None

Returns

0x00: External reset or Power on reset
0x01: Low voltage detection
0x02: Illegal memory access
0x04: RAM parity error (read from no initialized area)
0x10: Watch dog timer
0x80: Illegal instruction

getTemperature

Description

Get temperature.

Syntax

int getTemperature(uint8_t mode)

Parameters

mode: Specify TEMP_MODE_CELSIUS in the case of Celsius, specify TEMP_MODE_FAHRENHEIT in the case of Fahrenheit

Returns

Temperature(int)

Comment

Has a margin of error of 1 degree one way or the other.


Example

This example shows temperature every 1 second.


        #include <Arduino.h>
        void setup() {
          Serial.begin(9600);
        }
         
        void loop()
        {
          Serial.print("Temperature: ");
          Serial.println(getTemperature(TEMP_MODE_CELSIUS));
          delay(1000);
         
        }