We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0c5275 commit e28f479Copy full SHA for e28f479
src/MagneticSensorI2C.cpp
@@ -49,8 +49,20 @@ MagneticSensorI2C::MagneticSensorI2C(MagneticSensorI2CConfig_s config){
49
50
void MagneticSensorI2C::init(){
51
52
+#if defined(_STM32_DEF_) // if stm chips
53
+ // I2C communication begin
54
+ Wire.begin();
55
+ Wire.setClock(clock_speed);
56
+ Wire.setSCL(scl_pin);
57
+ Wire.setSDA(sda_pin);
58
+#elif defined(ESP_H) // if esp32
59
//I2C communication begin
60
Wire.begin(sda_pin, scl_pin, clock_speed);
61
+#else
62
63
64
65
+#endif
66
67
// velocity calculation init
68
angle_prev = 0;
0 commit comments