# Change XYZ to the UID of your Distance IR Bricklet 2.0

setup:
	# Handle incoming distance callbacks
	subscribe to tinkerforge/callback/distance_ir_v2_bricklet/XYZ/distance
	publish '{"register": true}' to tinkerforge/register/distance_ir_v2_bricklet/XYZ/distance # Register distance callback
	
	# Configure threshold for distance "smaller than 30 cm"
	# with a debounce period of 1s (1000ms)
	publish '{"period": 1000, "value_has_to_change": false, "option": "smaller", "min": 300, "max": 0}' to tinkerforge/request/distance_ir_v2_bricklet/XYZ/set_distance_callback_configuration  
