The function of the i2c API?

This code gives error message: index ‘write’ does not exist

const adress ="\\x01";
i2c_port<- hardware.i2c12.configure(CLOCK_SPEED_10_KHZ); 

but no error from this (of course…)

io_port<- hardware.pin1.configure(DIGITAL_OUT);

What do I miss?

The address parameter needs to be a number, not a string.
Also, changed the code to first assign the i2c object and then call configure.

const adress =0x01; i2c_port<-hardware.i2c12; i2c_port.configure(CLOCK_SPEED_10_KHZ); i2c_port.write(adress,"");

The documentation states that the return value for i2c.configure is nothing. Therefore you were calling write on a non existent object.


Availability: device
Returns: nothing