Hi,
das Programm ist in ordnung.
Hast Du PullUp Resistors in SDA und SCL ? Eg: 1,8k