Arduino sketch update to match API