Help on data adquisition from analog and digital sensor

Hi there,
I have no idea on how to run 2 codes in 1 in order to get data via Gobetwino software.
1 code can be found in here: Tutorial: Reading Water Flow rate with Water Flow Sensor - #2 by ESP - Grove - Seeed Forum
and the other in here : Gadgets og teknologi | Dansk Tech Blog - Mikmo after downloading the program, under gobetwinoLogTest.pde file in samples folder. I also attach them in here.

My code looks like this, but I know there must be lots of mistakes because I have no idea on programing, I barely know the language what means each function and /or how to dispose it in the right secuence.
Can someone help me? I´m not pluggin it the sensors yet to check if it works, could this be another reason? When I run it I don´t get anything, its like Arduino board remain in standbymode.
thank´s

int serInLen = 25;
char serInString[25];
int sensorValue = analogRead(A1);
volatile int NbTopsFan; 
int Calc;                               
int hallsensor = 2;
int logValue3=0;
int result;
void rpm ()   
{ 
  NbTopsFan++; 
} 

void setup() 

{ 


  pinMode(hallsensor, INPUT);
  Serial.begin(9600);
  
 attachInterrupt(0, rpm, RISING); 
 randomSeed(analogRead(0));
 Serial.println("#S|CPTEST|[]#");
 readSerialString(serInString,1000);

} 
 
void loop() 
{ 

   int sensorValue = analogRead(A1);
   float depth = sensorValue * (500 / 1023.0);
   NbTopsFan = 0;   
   sei();      
   delay(1000);
   cli();      
   Calc = (NbTopsFan * 60);  
   logValue3= random(0,1000);
   logData(depth,Calc,logValue3);
    
}


 
void logData( int depth, int Calc, int value3) 
{
   char buffer[5];
  
   Serial.print("#S|LOGTEST|[");
   Serial.print(itoa((depth), buffer, 10));
   Serial.print(";");
   Serial.print(itoa((Calc), buffer, 10));
   Serial.print(";");
   Serial.print(itoa((value3), buffer, 10));
   Serial.println("]#");
   readSerialString(serInString,1000);
   
} 


void readSerialString (char *strArray,long timeOut) 
{
   long startTime=millis();
   int i;

   while (!Serial.available()) {
      if (millis()-startTime >= timeOut) {
         return;
      }
   }
   while (Serial.available() && i < serInLen) {
      strArray[i] = Serial.read();
      i++;
   }
}

gobetwinoLogTest.pde (1.93 KB)

waterflow.ino (1.38 KB)

The first mistake is you didn't use code tags (use the # button above the editor).

thank´s majenko
I´ve changed it.
and the second mistake?

To combine two "codes" together you first have to understand how both "codes" work.

Then you have to create a new sketch ("code") that does the job of both together. You can't just join two sketches and expect them to work.

If the original sketches are written well, there will be simple functions that you call and it does the work. Copying these functions to your new sketch may be enough to give you access to them from your own code. If not, then you need to understand just what they are doing and re-write it in a way that fits with your own program.

I more or less know how each code works, and I did try them.
I also did try to create the "new" code, but it´s not working because as you can see I don´t have knowledge enough. That is the reason I´m on this forum, so maybe somebody can help me.
Can you help me?

A couple of notes:

  1. All times should be "unsigned long", not "long".
  2. Your readSerialString doesn't do quite what you think it does.

xJArduinox:
When I run it I don´t get anything, its like Arduino board remain in standbymode.

You should at least see the output from those print statements in setup(). If not, I suggest you comment out the code to register that interrupt handler and see whether that's causing the problem.

I also did try to create the "new" code, but it´s not working because as you can see I don´t have knowledge enough.

See this for help on merging code.
http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html