ice,

the code example is tested and working.

There must be something wrong in your Hardware.

could you post your schematic?