Arduino code for mid term demo