Solved
I2C does not work with Arduino IDE and STM32L152
Hi,
I tried the following program:
#include <Wire.h>
void setup()
{
Wire.begin(); //creates a Wire object
// set I/O pins to outputs
Wire.beginTransmission(0x20); // MCP 23008 Port Expander
Wire.write(0x00); //selects the IODIRA register
Wire.write(0x00); //this sets all port A pins to outputs
Wire.endTransmission(); //stops talking to device
}
void loop()
{
Wire.beginTransmission(0x20);
Wire.write(0x09); //selects the GPIO pins
Wire.write(0xFF); // turns on pins 0 and 1 of GPIOA
Wire.endTransmission(); //ends communication with the device
}I use D15 (SCL) ans D14 (SDA) with a Microchip PKSerial-I2C1 demoboard. Program does not work.
Can somebody please help?
Dear Peter