sorry about the code here it is
[code lang="cpp"]
#include
void setup()
{
Wire.beginOnPins(5,6);
Wire.begin(); // join i2c bus (address optional for master)
//int reset_command = 4096;
//Wire.write(reset_command);
//int enable = 7168;
//Wire.write(enable);
}
byte val = 0;
void loop()
{
Wire.beginTransmission(46); // transmit to device #44 (0x2c)
// device address is specified in datasheet
//int output = val+1024;
Wire.write(byte(0x00)); // sends instruction byte
Wire.write(val); // sends instruction byte
//Wire.write(output); // sends potentiometer value byte
Wire.endTransmission(); // stop transmitting
val++; // increment value
if(val == 1023) // if reached 64th position (max)
{
val = 0; // start over from lowest value
}
delay(1000);
}[/code]
[code lang="cpp"]
#include
void setup()
{
Wire.beginOnPins(5,6);
Wire.begin(); // join i2c bus (address optional for master)
//int reset_command = 4096;
//Wire.write(reset_command);
//int enable = 7168;
//Wire.write(enable);
}
byte val = 0;
void loop()
{
Wire.beginTransmission(46); // transmit to device #44 (0x2c)
// device address is specified in datasheet
//int output = val+1024;
Wire.write(byte(0x00)); // sends instruction byte
Wire.write(val); // sends instruction byte
//Wire.write(output); // sends potentiometer value byte
Wire.endTransmission(); // stop transmitting
val++; // increment value
if(val == 1023) // if reached 64th position (max)
{
val = 0; // start over from lowest value
}
delay(1000);
}[/code]