hey all im so clueless about how to write for a i2c device.
this is what i have managed to work out from the data sheet
im using a pca9635 to get 16 move PWM pins
at the moment it does nothing but the led comes on at the end to indicates that its done sending i2c.
i have output 0 and 1 connected to a h-bridge
plz help!!!!
this is what i have managed to work out from the data sheet
im using a pca9635 to get 16 move PWM pins
Code:
//#include <i2c_t3.h>
#include <Wire.h>
int led = 13;
void setup(){
// Wire.begin(I2C_MASTER, 0x00, I2C_PINS_18_19, I2C_PULLUP_EXT, I2C_RATE_100);
/* Wire.begin(mode, address, pins, pullup, rate);
mode = I2C_MASTER, I2C_SLAVE
address = 7bit slave address when configured as Slave (ignored for Master mode)
pins = (Wire) I2C_PINS_18_19, I2C_PINS_16_17 or (Wire1) I2C_PINS_29_30, I2C_PINS_26_31
pullup = I2C_PULLUP_EXT, I2C_PULLUP_INT
rate = I2C_RATE_100, I2C_RATE_200, I2C_RATE_300, I2C_RATE_400, I2C_RATE_600, I2C_RATE_800, I2C_RATE_1000, I2C_RATE_1200, I2C_RATE_1500, I2C_RATE_2000, I2C_RATE_2400
*/
Wire.begin();
Serial.begin(115200);
pinMode(led, OUTPUT);
delay(2500);
Wire.beginTransmission(0x01);
Wire.write(0x00);
Wire.write(0x00);
Wire.endTransmission();
delay(500);
Wire.beginTransmission(0x01);
Wire.write(0x14);
Wire.write(0xff);
Wire.endTransmission();
delay(500);
Wire.beginTransmission(0x01);
Wire.write(0x02);
Wire.write(0xff);
Wire.endTransmission();
delay(500);
Wire.beginTransmission(0x01);
Wire.write(0x02);
Wire.write(0x00);
Wire.endTransmission();
digitalWrite (led, HIGH);
}
void loop(){
}
at the moment it does nothing but the led comes on at the end to indicates that its done sending i2c.
i have output 0 and 1 connected to a h-bridge
plz help!!!!