Hi guys, as you know 328p has only 1 channel I2C, which limits the use of 2 AS5600 at the same time. so I made a board with 328pb, two I2Cs for as5600 sensor. but there are some problems with the code
> TwoWire Wire1(PE0, PE1);
// I2C magnetic sensor instance
MagneticSensorI2C sensor1 = MagneticSensorI2C(AS5600_I2C);
MagneticSensorI2C sensor2 = MagneticSensorI2C(AS5600_I2C);
// example of stm32 defining 2nd bus
// To be tested in mega328pb, PE0 & PE1 are the second I2C port for 328pb
TwoWire Wire1(PE0, PE1);
I add the lib of minicore, and selsect 328pb, but the IDE didnt know âTwoWire Wire1(PE0, PE1)â
Arduino: 1.8.8 (Windows 10), Board: "ATmega328, Yes (UART0), EEPROM retained, 328PB, BOD 4.3V, LTO disabled, External 16 MHz"
atmega328pb_bldc_magnetic_i2c:53:23: error: no matching function for call to 'TwoWire::TwoWire(int, int)'
TwoWire Wire1(PE0, PE1);
^
In file included from C:\Users\310210741\Documents\Arduino\libraries\Simple_FOC\src/sensors/MagneticSensorI2C.h:5:0,
from C:\Users\310210741\Documents\Arduino\libraries\Simple_FOC\src/SimpleFOC.h:103,
from C:\Users\310210741\Downloads\Simple FOC\Datasheet & referance\Arduino-FOC-minimal\library_source\atmega328pb_bldc_magnetic_i2c\atmega328pb_bldc_magnetic_i2c.ino:39:
C:\Users\310210741\Documents\Arduino\hardware\MiniCore-master\avr\libraries\Wire\src/Wire.h:115:5: note: candidate: TwoWire::TwoWire(int, void (*)(), void (*)(), void (*)(uint8_t), void (*)(uint32_t), uint8_t (*)(uint8_t, uint8_t*, uint8_t, uint8_t), uint8_t (*)(uint8_t, uint8_t*, uint8_t, uint8_t, uint8_t), uint8_t (*)(const uint8_t*, uint8_t), void (*)(uint8_t), void (*)(), void (*)(), void (*)(void (*)(uint8_t*, int)), void (*)(uint8_t*, int), void (*)(void (*)()), void (*)())
TwoWire(int bufferLength,
^~~~~~~
C:\Users\310210741\Documents\Arduino\hardware\MiniCore-master\avr\libraries\Wire\src/Wire.h:115:5: note: candidate expects 15 arguments, 2 provided
C:\Users\310210741\Documents\Arduino\hardware\MiniCore-master\avr\libraries\Wire\src/Wire.h:87:7: note: candidate: constexpr TwoWire::TwoWire(const TwoWire&)
class TwoWire : public Stream
^~~~~~~
C:\Users\310210741\Documents\Arduino\hardware\MiniCore-master\avr\libraries\Wire\src/Wire.h:87:7: note: candidate expects 1 argument, 2 provided
exit status 1
no matching function for call to 'TwoWire::TwoWire(int, int)'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I know itâs write for stm32, is there any .h file that need to modify to adapt to 328pb? I checked into the define of TwoWire class(wire.h), but thatâs bit of complex for me -_-âŚ