draagc / OctoPrint-FilamentEncore

OctoPrint plug-in that detects when printer is out of filament
GNU General Public License v3.0
5 stars 1 forks source link

add GPIO.PUD_DOWN option #2

Open frantisekbrabec opened 5 years ago

frantisekbrabec commented 5 years ago

My specific sensor (seems to be the same used by TH3D - https://www.th3dstudio.com/product/ezout-v2-filament-sensor-only-replacement-spare/) goes HIGH when filament is present and LOW when absent.

I wired it the most straightforward way (Vcc-Vcc, GND-GND, signal-GPIO; no resistors, etc).

The only way I can read correct GPIO values is when I set up the IO with pull_up_down=GPIO.PUD_DOWN option. However, the plugin code has pull_up_down=GPIO.PUD_UP hardwired. It probably should be parameter driven, perhaps derived from the existing 'switch' parameter?