Added i2c for raspberry pi and bug fixes