Please try using it with Arduino IDE version 1.6.5. Your code works without any errors in this version of IDE.