Skip to content

thermistor.read() return wrong value #10

@sylim5442

Description

@sylim5442

I'm using 1.0.3 library
Situation:
when #include <thermistor.h>

Real Temp: 31.23 °C
Using line: thermistor.read();

Expected behavior: return 31.23
Actual behavior : return 312

Problem
-- thermistor.cpp

line 76 : int THERMISTOR::read(void)
line 127 : return (int)(steinhart * 10);

-- thermistor.h

line 77 : int read(void);

My Fix
-- thermistor.cpp

line 76 : float THERMISTOR::read(void)
line 127 : return (float)(steinhart);

-- thermistor.h

line 77 : float read(void);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions