ostaquet / Arduino-MQ131-driver

Arduino driver for gas sensor MQ131 (Ozone / O3)
MIT License
66 stars 19 forks source link

About declaration and the type of variable of RL. #35

Closed ferreiradiego closed 4 years ago

ferreiradiego commented 4 years ago

Hello,

@ostaquet I have a little question.

Why you declare in the header of the library, the var valueRL as uint16_t (uint16_t valueRL = -1;) and in the method begin(uint8_t _pinPower, uint8_t _pinSensor, MQ131Model _model, uint32_t _RL, Stream* _debugStream = NULL); the _RL as uint32_t?

I am asking this question because when I print the uint32_t _RL when I'm using RL = 1MOhm the value printed is 1M, but when I print uint16_t valueRL the value printed is 16960. Is this right?

One more thing, if I use RL = 10kOhm, the value of RL both declared as uint16_t and uint32_t is 10k.

I hope you understand me. Thanks!!!

Best Regards, Diego Ferreira

ostaquet commented 4 years ago

Damned! You're right.

valueRL should be uint32_t. 😅

It is fixed. Thanks for noticing!