adafruit / Adafruit_BME280_Library

Arduino Library for BME280 sensors
Other
340 stars 306 forks source link

protected instead of private #46

Closed espHorst closed 5 years ago

espHorst commented 5 years ago

Dear all, would it be an option to change the private methods and variables to protected? I would like to access the private methods in an inherited class. Best regards, espHorst

ladyada commented 5 years ago

kinda odd class to need to inherit - is it something not implemented here? :)

espHorst commented 5 years ago

I added the BME280 to an existing Arduino Mini Pro hardware. Now I'm running out of program memory. Dropping the float library solves the issue - thus I changed the return value of the methods

        //returns: kelvin * 10
        uint16_t readTemperature(void);
        //returns: pascal * 10
        uint16_t readPressure(void);
        //returns: %
        uint8_t readHumidity(void);

and everything is fine. As I'm not sure that anybody else needs this I just wanted to inherit the existing class. This requires protected instead of private. If you think that more people need alternative methods returning integer values I'm happy to provide a PR adding the integer functions. Best regards, espHorst

ladyada commented 5 years ago

oi, yeah ok - if you do a PR making things protected instead of private, & it passes travis we'll take a look :)

espHorst commented 5 years ago

Thanks again for merging the new PR.