Arduino code for chapter 4