How to remake this sketch?

Hello,

Im trying to do a sketch who controlles an RGB LED. I founded the code pasted at the bottom but its for two rgb lines and works with eeprom library, i dont know why.
Shortly, the functions Im searching are:

1.- Smartphone pairs to arduino with bluetooth
2.-Arduino waits to smartphone data
3.- Smartphone sends data to arduino (colour combination and time to show it)
4.- Arduino receives this information and sends to pins 9,10 and 11 (pwm each one for each colour)
5.- When ends, wait for another signal from smartphone or finish the program and unpair if smartphone says it

Is it possible with this sketch? What do you recommend me to achieve my objective?

Thanks

/*
    //librerias
   #include <EEPROM.h>
 
    int ledRojo = 10; 
    int ledVerde=11; 
    int ledAzul=9;  
    int ledRojo2 = 5; 
    int ledVerde2=6; 
    int ledAzul2=3;  
    int red;
    int green;
    int blue;
    int accion=0;
    int bluetooth=2;
    int puerto=0;
    int primeraVez;
    int pinDefecto=1234;
    
     
    void setup() 
    {
      pinMode(bluetooth,OUTPUT); 
      digitalWrite(bluetooth,HIGH);
      
      Serial.begin(9600);
      
      primeraVez=EEPROM.read(0);
      
      if(primeraVez!=1){
        color(0,255,255);
        programer(pinDefecto);
        EEPROM.write(0,1);
        color(255,0,255);
      }
    }
     
    void loop() 
    {          
      
      while (Serial.available() > 0) {
        
        accion = Serial.parseInt();

           if(accion==1){
              puerto=Serial.parseInt();
              red = Serial.parseInt();
              green = Serial.parseInt();
              blue = Serial.parseInt();
           }
           if (Serial.read() == '\n') {
               color(red,green,blue);
           }
      }
      if(accion==2){
              color(0,255,255);
              delay(500);
              color(255,0,255);
              delay(500);
              color(255,255,0);
              delay(500);
      }
      if(accion==3){
        int pin = Serial.parseInt();
        
        if (Serial.read() == '\n') {
          color(255,0,0);
          programer(pin);
          accion=0;
          color(0,255,0);
        }  
        
      }
      
     
    }
    
    void programer(int pin){
        digitalWrite(bluetooth,LOW);
        delay(250);
        digitalWrite(bluetooth,HIGH);
        delay(5000);
        Serial.print("AT");
        delay(1000);
        Serial.print("AT+NAMEOMNIBLUG");
        delay(1000);
        Serial.print("AT+PIN"+pin);
        delay(1000);
        digitalWrite(bluetooth,LOW);
        delay(250);
        digitalWrite(bluetooth,HIGH);
    }
    
    
     
    void color(int rojo, int verde, int azul){
        
        if(puerto==1){
          analogWrite(ledRojo, rojo);
          analogWrite(ledVerde, verde);
          analogWrite(ledAzul, azul);
        }
        if(puerto==2){
          analogWrite(ledRojo2, rojo);
          analogWrite(ledVerde2, verde);
          analogWrite(ledAzul2, azul);
        }
        if(puerto==3){
          analogWrite(ledRojo, rojo);
          analogWrite(ledRojo2, rojo);
          analogWrite(ledVerde, verde);
          analogWrite(ledVerde2, verde);
          analogWrite(ledAzul, azul);
          analogWrite(ledAzul2, azul);
        
        }
        
    }
  
    //Fin

moderator: added code tags ==> # button above smileys

Have you heard of Google ? https://www.google.com/#q=arduino+android+bluetooth

Melkor: Is it possible with this sketch? What do you recommend me to achieve my objective?

Couple of points.

It is very difficult to read code when you don't post it using code tags (the # button) as explained in How to use the forum. Code should look like this

You need to try your code and if it doesn't work you need to tell us what it should do and what it actually does. It would take a very long time to study strange code and figure out everything about it.

...R

Don't bother. He didn't write that. He found it and thinks it can be modified. @OP, Instead of looking for a complete sketch written by someone else who knew what they were doing, maybe it would be better if you read some of the links in the google search I linked and learn something about arduino -bluetooth operation so you will know what you are doing ? We are not going to re-write the code you posted. You need to learn how to use bluetooth and then you can re-write it yourself.

Raschemmel You Might be a little kinder not? Obviously my intention is NOT to wait someone to rewrite the whole code. Im only searching for little tips to modify. If it is not possible I understand it, but it doesnt mean that you can talk to me like a tapped.

Reread my post. I did not insult you. I was not rude. What I said I meant literally. I really do believe that the links in the Google search I posted ARE the best approach for you. It is my duty as a topic expert to tell you the truth rather than what you want to hear. If you reread my post you will see thar is all I have done. If you are here to learn and not recruit someone to rewrite your code you will appreciate me posting a link to some tutorials on bluetooth. If you aren't here to learn how to use bluetooth then that leaves only one other possubillity. If you feel you have been wronged in any way you are certainly welcome to go click on " Report to Moderator" link on the specific offending post. The only post the Moderator will only examine the Reply where you click on the report link, since each Reply has such a link. Good luck.

BTW, I don't unxerstand your wording. What does " like a tapped" mean? What is that ? Is that English ?