import time from pymax30102 import MAX30102 # Initialize sensor sensor = MAX30102() print("Put your finger on the sensor...") try: while True: # We read the Red and IR light intensity red, ir = sensor.read_sequential() print(f"Red: {red}, IR: {ir}") # Check if finger is there if ir < 50000: print("No finger detected!") time.sleep(0.1) except KeyboardInterrupt: print("Stopped.")