Utility

The components of the Utility library can be found below.

softwareReset

Description

Generate a reset.

Syntax

void softwareReset()

Parameters

None

Returns

None

getResetFlag

Description

Gets 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 the temperature

Syntax

int getTemperature(uint8_t mode)

Parameters

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

Returns

Temperature(int)

Comment

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


Example

This example shows the 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);
            
        }