Made a few changes to make the code compatible with the Arduino IDE

Hi there,

I have made some changes to the code to make it compatible with the latest version of the  Arduino IDE.