From b6f6d8e2d4eab98dad49a1dc9999371354567589 Mon Sep 17 00:00:00 2001 From: ademant Date: Thu, 27 Jun 2019 05:47:58 +0200 Subject: [PATCH] change log geiger to bcm 0 --- log_geiger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/log_geiger.py b/log_geiger.py index 26a9f8c..a26f9f8 100644 --- a/log_geiger.py +++ b/log_geiger.py @@ -2,8 +2,8 @@ import time from datetime import datetime import RPi.GPIO as GPIO -GPIO.setmode(GPIO.BOARD) # use RaspPi board layout pin numbering -GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP) +GPIO.setmode(GPIO.BCM) # use RaspPi board layout pin numbering +GPIO.setup(0, GPIO.IN, pull_up_down=GPIO.PUD_UP) counter = 0 @@ -13,14 +13,14 @@ def tube_impulse_callback(channel): # threaded callback -- falling edge detected # when a falling edge is detected on port 12, regardless of whatever # else is happening in the program, the tube_impulse_callback will be run -GPIO.add_event_detect(12, GPIO.FALLING, callback=tube_impulse_callback) +GPIO.add_event_detect(0, GPIO.FALLING, callback=tube_impulse_callback) try: while True: currentMinute = datetime.now().minute while datetime.now().minute == currentMinute: # this minute.. time.sleep(1) # .. wait while add_event_detect detects pulses - print counter + print str(counter)+" cpm" counter=0 # reset counter except KeyboardInterrupt: GPIO.cleanup() # clean up GPIO on CTRL+C exit