TTGO board with tipping bucket rain gauge

Do someone give some advice to upload a good sketch to connect a TTGO-T-Beam board with tipping bucket rain gauge (with two switch contacts) and send the data to TTN?