# Change XYZ to the UID of your Industrial Digital In 4 Bricklet 2.0

setup:
	# Configure rising edge count (channel 3) with 10ms debounce
	publish '{"channel": "3", "edge_type": "rising", "debounce": 10}' to tinkerforge/request/industrial_digital_in_4_v2_bricklet/XYZ/set_edge_count_configuration

	# Get edge count 10 times with 1s delay
	for i in 0..9

		wait for 1s

		# Get current edge count
		subscribe to tinkerforge/response/industrial_digital_in_4_v2_bricklet/XYZ/get_edge_count
		publish '{"channel": "3", "reset_counter": false}' to tinkerforge/request/industrial_digital_in_4_v2_bricklet/XYZ/get_edge_count

	endfor
