arduarn:
If I understood, the loadFile() function slurps up the data into the arrays and correctly Serial.print()'s them out, right?
So what exactly is the output of the Serial.print()'s in s2_aCon()?
And what are you expecting them to be?
In fact, why not just post all the serial console output (matching the code you most recently posted).
The loadFile function takes the lines from a text file one by one and parses them into respective arrays. The serial prints were just for my own ability to check that the work was being done by printing off the array values afterward.
This is the printout that shows the arrays that are getting zeros:
16:43:38.603 -> 1=======Load Save=======
16:43:39.174 -> saveStat / saveBlock
16:43:39.174 -> 1
16:43:39.174 -> 1
16:43:39.174 -> PICKUP NAME
16:43:39.174 -> File 1 :]
16:43:39.174 -> RPMs
16:43:39.174 -> 900
16:43:39.174 -> bobbinPlate
16:43:39.174 -> 1.20
16:43:39.174 -> bobbinSpace
16:43:39.174 -> 22.00
16:43:39.174 -> gauge
16:43:39.211 -> 0.06
16:43:39.211 -> dirCW
16:43:39.211 -> false
16:43:39.211 -> false
16:43:39.211 -> BLOCK NUMBERS
16:43:39.211 -> 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
16:43:39.211 -> BLOCK AREA
16:43:39.211 -> 1,6,3,4,5,1,6,3,4,5,1,6,3,4,5,1,6,3,4,5,
16:43:39.211 -> BLOCK STRAFE
16:43:39.211 -> 1,4,3,2,1,3,2,4,1,2,1,4,3,2,1,3,2,4,1,2,
16:43:39.211 -> BLOCK WINDS
16:43:39.211 -> 1000,100,400,600,2000,6000,4000,200,100,400,600,2000,6000,4000,200,100,400,600,2000,6000,0
16:43:39.354 -> Move1: 800000
16:43:39.354 -> blockArea: 1
16:43:39.354 -> blockStrafe: 1
16:43:39.354 -> Move2_A: 0
16:43:39.354 -> Move2_B: 0
16:43:39.354 -> 1
16:43:39.354 -> Move1: 80000
16:43:39.354 -> blockArea: 6
16:43:39.354 -> blockStrafe: 4
16:43:39.354 -> Move2_A: 0
16:43:39.354 -> Move2_B: 0
16:43:39.354 -> 2
16:43:39.354 -> Move1: 320000
16:43:39.354 -> blockArea: 3
16:43:39.354 -> blockStrafe: 3
16:43:39.354 -> Move2_A: 0
16:43:39.354 -> Move2_B: 0
16:43:39.354 -> 3
16:43:39.354 -> Move1: 480000
16:43:39.354 -> blockArea: 4
16:43:39.354 -> blockStrafe: 2
16:43:39.354 -> Move2_A: 0
16:43:39.354 -> Move2_B: 0
16:43:39.354 -> 4
16:43:39.354 -> Move1: 1600000
16:43:39.354 -> blockArea: 5
16:43:39.354 -> blockStrafe: 1
16:43:39.354 -> Move2_A: 0
16:43:39.354 -> Move2_B: 0
16:43:39.387 -> 5
16:43:39.387 -> Move1: 4800000
16:43:39.387 -> blockArea: 1
16:43:39.387 -> blockStrafe: 3
16:43:39.387 -> Move2_A: 0
16:43:39.387 -> Move2_B: 0
16:43:39.387 -> 6
16:43:39.387 -> Move1: 3200000
16:43:39.387 -> blockArea: 6
16:43:39.387 -> blockStrafe: 2
16:43:39.387 -> Move2_A: 0
16:43:39.387 -> Move2_B: 0
16:43:39.387 -> 7
16:43:39.387 -> Move1: 160000
16:43:39.387 -> blockArea: 3
16:43:39.387 -> blockStrafe: 4
16:43:39.387 -> Move2_A: 0
16:43:39.387 -> Move2_B: 0
16:43:39.387 -> 8
16:43:39.387 -> Move1: 80000
16:43:39.387 -> blockArea: 4
16:43:39.387 -> blockStrafe: 1
16:43:39.387 -> Move2_A: 0
16:43:39.387 -> Move2_B: 0
16:43:39.387 -> 9
16:43:39.387 -> Move1: 320000
16:43:39.387 -> blockArea: 5
16:43:39.387 -> blockStrafe: 2
16:43:39.387 -> Move2_A: 0
16:43:39.387 -> Move2_B: 0
16:43:39.387 -> 10
16:43:39.387 -> Move1: 480000
16:43:39.423 -> blockArea: 1
16:43:39.423 -> blockStrafe: 1
16:43:39.423 -> Move2_A: 0
16:43:39.423 -> Move2_B: 0
16:43:39.423 -> 11
16:43:39.423 -> Move1: 1600000
16:43:39.423 -> blockArea: 6
16:43:39.423 -> blockStrafe: 4
16:43:39.423 -> Move2_A: 0
16:43:39.423 -> Move2_B: 0
16:43:39.423 -> 12
16:43:39.423 -> Move1: 4800000
16:43:39.423 -> blockArea: 3
16:43:39.423 -> blockStrafe: 3
16:43:39.423 -> Move2_A: 0
16:43:39.423 -> Move2_B: 0
16:43:39.423 -> 13
16:43:39.423 -> Move1: 3200000
16:43:39.423 -> blockArea: 4
16:43:39.423 -> blockStrafe: 2
16:43:39.423 -> Move2_A: 0
16:43:39.423 -> Move2_B: 0
16:43:39.423 -> 14
16:43:39.423 -> Move1: 160000
16:43:39.423 -> blockArea: 5
16:43:39.423 -> blockStrafe: 1
16:43:39.423 -> Move2_A: 0
16:43:39.423 -> Move2_B: 0
16:43:39.423 -> 15
16:43:39.423 -> Move1: 80000
16:43:39.423 -> blockArea: 1
16:43:39.423 -> blockStrafe: 3
16:43:39.423 -> Move2_A: 0
16:43:39.423 -> Move2_B: 0
16:43:39.461 -> 16
16:43:39.461 -> Move1: 320000
16:43:39.461 -> blockArea: 6
16:43:39.461 -> blockStrafe: 2
16:43:39.461 -> Move2_A: 0
16:43:39.461 -> Move2_B: 0
16:43:39.461 -> 17
16:43:39.461 -> Move1: 480000
16:43:39.461 -> blockArea: 3
16:43:39.461 -> blockStrafe: 4
16:43:39.461 -> Move2_A: 0
16:43:39.461 -> Move2_B: 0
16:43:39.461 -> 18
16:43:39.461 -> Move1: 1600000
16:43:39.461 -> blockArea: 4
16:43:39.461 -> blockStrafe: 1
16:43:39.461 -> Move2_A: 0
16:43:39.461 -> Move2_B: 0
16:43:39.461 -> 19
16:43:39.461 -> Move1: 4800000
16:43:39.461 -> blockArea: 5
16:43:39.461 -> blockStrafe: 2
16:43:39.461 -> Move2_A: 0
16:43:39.461 -> Move2_B: 0
I had some more detailed serial prints before that showed the rest of the arrays, but these are the ones that are not receiving their results:
long MaxSpeed1 = (RPMs*800)/60;
long Accel1 = 2000; // I don't know if this one is getting its numbers or not since I didn't print it
long Move1[21]; // Move1 comes out fine.
long MaxSpeed2[21];
int Move2_A[21];
int Move2_B[21];
// the dysfunctional ones are calculated in s2_aCon() - and they each have some floating / fractional type math going into the calculations. Move1 is also calculated in that function and it prints out fine.
All of this math worked when the two sketches were separate - this is the functional motor code and this is the functional nextion code.
I'm going to try increasing the char array size maybe - I checked over the for statements and they appear to all be referencing allotted array space, but I'm also dumb so maybe that needs some checking on too..
edit:
for reference, here is a serial print out from the functional separated motor code:
17:14:01.732 -> MAX_SPD:5000
17:14:01.732 -> MAX_XCL:100000
17:14:01.732 -> MaxSpeed1:14666
17:14:01.732 -> 1
17:14:01.732 -> Move1[]:800000
17:14:01.732 -> MaxSpeed2[]:432
17:14:01.732 -> Move2_A[]:0
17:14:01.732 -> Move2_B[]:858
17:14:01.732 -> 2
17:14:01.732 -> Move1[]:80000
17:14:01.732 -> MaxSpeed2[]:108
17:14:01.732 -> Move2_A[]:0
17:14:01.767 -> Move2_B[]:2600
17:14:01.767 -> 3
17:14:01.767 -> Move1[]:320000
17:14:01.767 -> MaxSpeed2[]:108
17:14:01.767 -> Move2_A[]:1716
17:14:01.767 -> Move2_B[]:2600
17:14:01.767 -> 4
17:14:01.767 -> Move1[]:480000
17:14:01.767 -> MaxSpeed2[]:432
17:14:01.767 -> Move2_A[]:0
17:14:01.767 -> Move2_B[]:1716
17:14:01.767 -> 5
17:14:01.767 -> Move1[]:1600000
17:14:01.767 -> MaxSpeed2[]:865
17:14:01.767 -> Move2_A[]:858
17:14:01.767 -> Move2_B[]:2600
17:14:01.767 -> 6
17:14:01.767 -> Move1[]:4800000
17:14:01.767 -> MaxSpeed2[]:108
17:14:01.767 -> Move2_A[]:0
17:14:01.767 -> Move2_B[]:858
17:14:01.767 -> 7
17:14:01.767 -> Move1[]:3200000
17:14:01.767 -> MaxSpeed2[]:650
17:14:01.767 -> Move2_A[]:0
17:14:01.767 -> Move2_B[]:2600
17:14:01.767 -> 8
17:14:01.767 -> Move1[]:160000
17:14:01.767 -> MaxSpeed2[]:35
17:14:01.767 -> Move2_A[]:1716
17:14:01.767 -> Move2_B[]:2600
17:14:01.806 -> 9
17:14:01.806 -> Move1[]:80000
17:14:01.806 -> MaxSpeed2[]:865
17:14:01.806 -> Move2_A[]:0
17:14:01.806 -> Move2_B[]:1716
17:14:01.806 -> 10
17:14:01.806 -> Move1[]:320000
17:14:01.806 -> MaxSpeed2[]:432
17:14:01.806 -> Move2_A[]:858
17:14:01.806 -> Move2_B[]:2600
17:14:01.806 -> 11
17:14:01.806 -> Move1[]:480000
17:14:01.806 -> MaxSpeed2[]:432
17:14:01.806 -> Move2_A[]:0
17:14:01.806 -> Move2_B[]:858
17:14:01.806 -> 12
17:14:01.806 -> Move1[]:1600000
17:14:01.806 -> MaxSpeed2[]:108
17:14:01.806 -> Move2_A[]:0
17:14:01.806 -> Move2_B[]:2600
17:14:01.806 -> 13
17:14:01.806 -> Move1[]:4800000
17:14:01.806 -> MaxSpeed2[]:108
17:14:01.806 -> Move2_A[]:1716
17:14:01.806 -> Move2_B[]:2600
17:14:01.806 -> 14
17:14:01.806 -> Move1[]:3200000
17:14:01.806 -> MaxSpeed2[]:432
17:14:01.806 -> Move2_A[]:0
17:14:01.806 -> Move2_B[]:1716
17:14:01.806 -> 15
17:14:01.806 -> Move1[]:160000
17:14:01.806 -> MaxSpeed2[]:865
17:14:01.806 -> Move2_A[]:858
17:14:01.840 -> Move2_B[]:2600
17:14:01.840 -> 16
17:14:01.840 -> Move1[]:80000
17:14:01.840 -> MaxSpeed2[]:108
17:14:01.840 -> Move2_A[]:0
17:14:01.840 -> Move2_B[]:858
17:14:01.840 -> 17
17:14:01.840 -> Move1[]:320000
17:14:01.840 -> MaxSpeed2[]:650
17:14:01.840 -> Move2_A[]:0
17:14:01.840 -> Move2_B[]:2600
17:14:01.840 -> 18
17:14:01.840 -> Move1[]:480000
17:14:01.840 -> MaxSpeed2[]:35
17:14:01.840 -> Move2_A[]:1716
17:14:01.840 -> Move2_B[]:2600
17:14:01.840 -> 19
17:14:01.840 -> Move1[]:1600000
17:14:01.840 -> MaxSpeed2[]:865
17:14:01.840 -> Move2_A[]:0
17:14:01.840 -> Move2_B[]:1716
17:14:01.840 -> 20
17:14:01.840 -> Move1[]:4800000
17:14:01.840 -> MaxSpeed2[]:432
17:14:01.840 -> Move2_A[]:858
17:14:01.840 -> Move2_B[]:2600