Arduino and ByVac BV4237 I2C controller

Been trying to get arduino to talk to a byvac BV4237 controller that i picked up on eBay. Handy device - 8 digital i/o ports, 5 channel ADC, real time clock and temperature sensor...but damned if I can get it to work at all (using Wire.h)

Has anyone had any luck with them?

Ignore me. Got it to work finally. Using the wrong address and reading the wrong datasheet ::slight_smile:

Here's a sample in case anyone else is struggling (flashes a couple pins and reads the temperature):

#include "Wire.h"
#define TEMP_SENSOR_ADDR 0x48
#define IO_BOARD_ADDR 0x31
#define LEDPIN 13

#define BAUDRATE 9600

void setup() {
delay(100);
Wire.begin(); // set up I2C
Serial.begin(BAUDRATE);
pinMode(LEDPIN, OUTPUT);

}

void loop() {

digitalWrite(LEDPIN,HIGH);//just so we know stuff's happening

//set pin 1 high...
Wire.beginTransmission(IO_BOARD_ADDR); // join I2C, talk to BV4206 by id
Wire.send(0x11); //tell it what pin you want
Wire.send(0x08); //the state of the pin, from 0-8 (PWM controls the levels)
Wire.endTransmission(); // leave I2C bus

//...and pin 2 low
Wire.beginTransmission(IO_BOARD_ADDR);
Wire.send(0x12); //set output command
Wire.send(0x00); //the pin
Wire.endTransmission();
delay(1000);

int temperature;
Wire.beginTransmission(TEMP_SENSOR_ADDR);
Wire.send(0x00);
Wire.requestFrom(TEMP_SENSOR_ADDR, 1);
if (Wire.available())
{
temperature = Wire.receive();
Serial.println(temperature);
}
else
{
Serial.println("---");
}
Wire.endTransmission();

//reverse the pin states
digitalWrite(LEDPIN,LOW);
Wire.beginTransmission(IO_BOARD_ADDR);
Wire.send(0x11);
Wire.send(0x00);
Wire.endTransmission();
Wire.beginTransmission(IO_BOARD_ADDR);
Wire.send(0x12);
Wire.send(0x08);
Wire.endTransmission();
delay(1000);
}