pimoroni / enviro

MIT License
104 stars 83 forks source link

Pin error in model() function #16

Closed vdomos closed 2 years ago

vdomos commented 2 years ago

Hi,

there is a pin error in the def model() function in the enviro/enviro/board.py file.

the function returns weather for the enviro weather pico board but just to be sure of the code

elif 35 in i2c_devices: # 35 = ltr-599 on grow & weather
    # the wind vane pin is pulled high with a 10k resistor on the weather
    # board - we can detect this and disambiguate using it
    pump1_pin = Pin(10, Pin.IN, Pin.PULL_UP)                                     # here pin10 is for rainmeter
    result = "grow" if pump1_pin.value() == False else "weather"

Shouldn't it be this?

pump1_pin = Pin(26, Pin.IN, Pin.PULL_UP)   # For windwane:     wind_direction_pin = Analog(26)
lowfatcode commented 2 years ago

Looks like the comment is outdated - the original approach of using the weather vane doesn't work so we switched to looking for the pull up on the first pump output of Grow.

I've cleaned up the comment in this commit https://github.com/pimoroni/enviro/commit/b96fdf2188e3cb1ceeef0d37c6fbbc371ab2dfef