Cast problem on arduino