Hi all,
I2C Guide
This small update is for getting the I2C working on the B-G431B-ESC1. It is still a bit experimental and sometimes buggy so I will update it again when necessary.
Hardware:
Solder the following pads:
It is recommended to use pull-up resistors.
Software:
In the file PeripheralPins.C, uncomment the following lines:
In the file Variant.h, change or add following lines (sometimes also works when you leave out this step but this seems to be more consistent.
Then in your platformio.ini file you must remove the build flags from the previous post and the following flags:
build_flags =
-D PIN_WIRE_SDA=PB7
-D PIN_WIRE_SCL=PB8
Other tips:
- Use the Platform.IO: Clean button to be sure that you are working with a clean configuration.
- Sometimes it can be useful to add the build flags from the previous post.
- Sometimes it can be useful to add
Wire.setClock(400000);
. - First add power to the board, then connect it with USB.
- Remove power when uploading new sketch.
- To get accurate sensor data, check with external power supply instead of USB power.
Greetings and good luck,
Wittecactus