arduino code for chapter 6