def tx433_set_message(message):
	# Send a first command to specify the size of the message that we will send.
	while True:
		if write_i2c_block(address, tx433_control_cmd + [tx433_control_set_buffer_subcmd, len(message), unused]) != -1:
			break
		time.sleep(0.5)
	time.sleep(0.5)

	# Send to the firmware the message to broadcast, 3 bytes at a time.
	for x in range(0, len(message) // 3):
		while True:
			if write_i2c_block(address, tx433_fill_buffer_cmd + [
				ord(message[x * 3]),
				ord(message[x * 3 + 1]),
				ord(message[x * 3 + 2]) ]) != -1:
				break
			time.sleep(.5)
		time.sleep(0.5)
	if len(message) % 3 == 1:
		while True:
			if write_i2c_block(address, tx433_fill_buffer_cmd + [
				ord(message[len(message) // 3 * 3]),
				unused,
				unused]) != -1:
				break
			time.sleep(.5)
		time.sleep(0.5)
	elif 3 % len(message) == 2:
		while True:
			if write_i2c_block(address, tx433_fill_buffer_cmd + [
				ord(message[len(message) // 3 * 3]),
				ord(message[len(message) // 3 * 3 + 1]),
				unused]) != -1:
				break
			time.sleep(.5)
		time.sleep(0.5)

# Request that the 433MHz RF link transmitter sends the prepared message.
# Message can be received by the matching 433MHz link receiver module running the sample 
# code provided on Seeedstudios wiki.
# (see http://www.seeedstudio.com/wiki/Grove_-_433MHz_Simple_RF_link_kit)
dataset/ETHPy150Open DexterInd/GrovePi/Firmware/Source/v1.2/grove_pi_v1_2_6/grovepi.py/tx433_set_message/swapped operands of `%`