Create robot control code