6 years, 3 months ago.

I2CSlave is undefined?

I keep getting

error: Identifier "I2CSlave" is undefined in "main.cpp", Line: 45, Col: 2

This is for an nRF52 board. It should work?

If anyone is looking for the answer to this, you need to create a mbed_app.json and put it in your project folder. The files should contain the code below in order to enable I2CSlave on the online compiler

{
    "target_overrides": {
        "*": {
            "target.device_has": ["I2CSLAVE"]
        }
    }
}
posted by Clayton Kimber 23 Oct 2018
Be the first to answer this question.