nightflyer88 / CG_scale

Schwerpunktwaage
Other
47 stars 15 forks source link

Tare via physical switch (ESP8266), experiment.. #20

Open ClausTonnesen opened 3 years ago

ClausTonnesen commented 3 years ago

I have added a physical switch to Tare the load cells when using the CG-Scale stand alone. Simple, apart from the limited amount of GPIO pins on the ESP8266, actually close to none free when using 3 load cells.

Simple, hook up to D8 (GPIO15), but that doesn't work for input.. back to reading the manual :( After reading a bit, I figured that the RX (GPIO3) could be used as input. It breaks the USB/Serial functionality, but when up and running and everything available via the Web GUI, I can live with that.

I haven't tested GPIO9/10 as my wire was to short, and no jumper around (and running out of time for today).

Anyway.. got it running like this In .h // Enable pull up on Tare input pin

ifdef PIN_TARE_BUTTON

pinMode(PIN_TARE_BUTTON, INPUT_PULLUP);

endif

In setup // use the RX pin for tare button input, BREAKS the USB/Serial interface, comment out for acces via USB!!

define PIN_TARE_BUTTON RX

Thoughts