Angles ang = {0.0,46,0,91,2,134,7,179.2} were measured, the unit is deg (steps). I have to implement code that initializes the values as a global array, and then sets the void function sumCum (float arr []) {} which calculates cumulative sums (Scum = {S1, S2, S3, ..., Sn} = X1, X1 + X2, X1 + X2 + X3, ..., X1 + X2 + ... + Xn} ) of each element, and writes the values to the console. Give an example usage (invoke function plus result in console).
float acc[]={0.0,46.0,91.2,134.7,179.2}
int accSize = 5;
void setup(){
Serial.begin(9600);
somaCum(acc);
}
void loop(){}
void somaCum(float acc[]){
for(int n=0;n<accSize;n++){
//Como é que faço a função?
}