# Change XYZ to the UID of your Distance IR Bricklet

setup:
	# Get threshold callbacks with a debounce time of 10 seconds (10000ms)
	publish '{"debounce": 10000}' to tinkerforge/request/distance-ir_bricklet/XYZ/set_debounce_period
	
	# Handle incoming distance reached callbacks
	subscribe to tinkerforge/callback/distance_ir_bricklet/XYZ/distance_reached
	publish '{"register": true}' to tinkerforge/register/distance_ir_bricklet/XYZ/distance_reached # Register distance_reached callback
	
	# Configure threshold for distance "smaller than 30 cm"
	publish '{"option": "smaller", "min": 300, "max": 0}' to tinkerforge/request/distance_ir_bricklet/XYZ/set_distance_callback_threshold
