encoding and arduino code