9 years, 2 months ago.

"Siren Lights" when initializing I2C

I'm trying to use the PTB1-PTB0 I2C bus on the Hexiwear to read from the heart-rate sensor and the ambient light sensor.

However, when I try to initialize I2C with the correct pins, I get the blinking red siren light. If I try to initialize it with the I2C bus on PTC11-PTC10 I don't get the siren light.

Here is the code I'm trying to use:

Test code

#include "mbed.h"

#define maxim_sda PTB1
#define maxim_scl PTB0

DigitalOut led_green(PTD0);

I2C i2c(maxim_sda, maxim_scl);

int main() {
    while (1) {
        led_green =! led_green;
        wait(200);
    }
}

If I comment out the I2C line, or change it to the other available I2C bus the program works as expected.

Any ideas on whats wrong?

Be the first to answer this question.