I've tried to read everything including this post: 2D-array as argument to function
I'm getting error: "cannot convert 'float' to 'float ()[8]' for argument '1' to 'float pzemGetter(float ()[8], PZEM004Tv30, byte)'"
Anyway, I couldn't make this code to work with arduino mega and pzem-004t v3 module... I'm just interested to get it in such way only to get a flexible code when using loops and things like that
`#include <PZEM004Tv30.h>`
`byte disabled = 150;`
`byte enabled = 180;`
`byte busyIndex = 0; //To ensure arduino mega is not busy before sending float array from PZEM`
`#define FLOATS_SENT 8`
`//============Arrays definition to be reported to raspberry through serial connection`
`float pzemGroup[8][8]; //A testing way to group pzem modules into array of arrays`
`byte statusArray[32];`
`PZEM004Tv30 pzemFrameGroup[] = {PZEM004Tv30(&Serial3, 0x42), PZEM004Tv30(&Serial3, 0x43),`
` PZEM004Tv30(&Serial3, 0x44), PZEM004Tv30(&Serial3, 0x45),`
` PZEM004Tv30(&Serial3, 0x46), PZEM004Tv30(&Serial3, 0x47),`
` PZEM004Tv30(&Serial3, 0x48), PZEM004Tv30(&Serial3, 0x49)`
};
`void setup() {`
`Serial.begin(115200); //This is the speed for serial monitoring`
`Serial2.begin(9600); //Speed for serial comm with raspberry pi through USB Serial FTDI adapter`
`delay(200);`
`}`
`void loop() {`
`pzemGetter(pzemGroup[3][], pzemFrameGroup[0], busyIndex = 8);`
`float testValue1 = pzemGroup[3][0];`
`float testValue2 = pzemGroup[3][1];`
`float testValue3 = pzemGroup[3][2];`
`}//End loop function`
`//Function definition to get data from energy modules pzem004t installed in the same bus`
`float pzemGetter (float (*frmEnergy)[8], PZEM004Tv30 pzemModule, byte busyFlagLocator) {`
`statusArray[busyFlagLocator] = enabled;`
`frmEnergy[0][0] = 26.10; //I added this one as a personal initial element verification in raspberry`
`frmEnergy[0][1] = pzemModule.voltage();`
`frmEnergy[0][2] = pzemModule.power();`
`frmEnergy[0][3] = pzemModule.current();`
`frmEnergy[0][4] = pzemModule.energy();`
`frmEnergy[0][5] = pzemModule.frequency();`
`frmEnergy[0][6] = pzemModule.pf();`
`frmEnergy[0][7] = 26.10; //I added this one as a personal final element verification in raspberry`
`statusArray[busyFlagLocator] = disabled;`
`}`