Making code consistent with newest Arduino API