gobetwino error

hi i got the folowing gobetwino code and i tried it in arduino and i got an error saying " Sending keys to process (pid here) failed Index was out of range." any tips would help.

//my code

void setup() {
Serial.begin(9600);

}

void loop()
{
char buffer[5];

// SENDK command

Serial.print("#S|SENDK|[");
Serial.print(itoa((5104), buffer, 10));
Serial.println("&{A}]#");
delay (10000);

}

OH MY! WHY?!

7! Why?! I am out of words...

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272236480
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272247211
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272161004
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272160006
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272384610
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272446428

  • the current

Why do you keep making new topics about the same? I really really REALLY don't get it.

Yes, i know you haven't wrote exactly this before, but you have made 6 other topics about pressing that damn key, and they are all also about Gobetwino in one or another way.

Using a topic is quite simple

  1. Post the problem
  2. Get a answer
  3. Tell if it made sense or not, if it did, then go to last point in the list
  4. Give more info about the problem or why you couldn't use the answer
  5. Get another answer, if someone know about another way to do it
  6. See if that could be usefull, if not, then go back to point 4
  7. Close the topic by saying you got it working, eventually also say how so others that might find the topic later also can use the info in it

The way you do it wastes too much time, both for people trying to help you, and the topic is completely useless to people finding it later, because they only find a whole bunch of topics, all with a tiny piece of information starting and ending no where, mixed up with a bunch of other topics that might have been found by the search too.

IT IS NOT THE SAME THING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IT IS COMPLEEETLY DIFERENT. IF YOU DONT HAVE ANYTHING NICE TO SAY THAN QUIT WASTING MY TIME. >:(

Okay, explain how typing a key, typing a key, typing a key, typing a key, typing a key, typing a key and typing a key is different from each other?

I know each human hand got 5 fingers, but that really doesn't count as 10 different ways either.

Only thing different this time, is that you posted some code this time, but it is still all about the same.

Maybe you think I am wasting your time, but if you look at my replies you will notice that I actually explain to you how a topic is used, this time in a very low level, since you apparently got no clue about that at all. And if you notice another thing, it is not only me that says that you are wrong about the way you do it. So what do you think? That everyone else is wrong, and you are the only one right?

This is like buying a whole bag of identical spray cans, only difference is the color, then ask about each color how you get the lid off...

IT IS NOT THE SAME THING

It's like watching a soap opera - or a train wreck - one of the two...

LOL ;D ;D ;D LOL

It's like watching a soap opera - or a train wreck - one of the two...

More like a sit-com... the same thing keeps on repeating itself....

Just to throw in a tiny scrap of useful info (which should be enough for most people, I reckon):
it says the process ID is out of range, in other words, it doesn't exist.. you got the wrong process ID.

Now for the love of all that is , listen to what bld says...

This is like buying a whole bag of identical spray cans, only difference is the color, then ask about each color how you get the lid off...

So, I got the lid off the red one. How do I get the lid off the green one?

The same way you remove the lid from the yellow one, but possibly turned 180 degrees.

The same way you remove the lid from the yellow one, but possibly turned 180 degrees.

Are you sure? Maybe I need to start a new thread.

You MUST use the SPRID command to start the program and return the ID you use for the SENDK command.

Anything else will not work. GoBetwino is not sending keys to Windows process ID's it is using it's own ID's

Check these lines from the sample below

  Serial.println("#S|SPXL|[]#");        // start EXCEL
  readSerialString(serInString, 5000);  // wait  5  seconds (max) for answer from Gobetwino (=porcess ID)

They ask GoBetwino to execute a SPRID command (called SPXL)that returns the processId of the started program (in this case Excel) this is the id that is used with the SENDK command later

int serInLen = 25;
char serInString[25];
int pId =0;
int result;

void setup() 
{ 
  Serial.begin(9600); 
  Serial.println("#S|SPXL|[]#");        // start EXCEL
  readSerialString(serInString, 5000);  // wait  5  seconds (max) for answer from Gobetwino (=porcess ID)
  pId= atoi(serInString);               // convert result to integer 
  sendPotValues();                       // send some data to Excell
} 
 
void loop() 
{ 
   //analogValue= random(0,1023);
   //logData(analogValue);
   //delay(5000); 
} 

void sendPotValues() 
{
   char buffer[5];
   int potValue1;
   int potValue2;
   
   for (int i=1; i<=15; i++){
     //Read the two pot values - could be any sensor value or whatever
     potValue1=analogRead(1);
     potValue2=analogRead(2);
  
    //Send the values as though it was typed into Excell, using the SENDK command
    // This is the total line that is send: #S,SENDK,[pId; potValue1 {TAB} potValue2 {DOWN} {LEFT} ]#
     Serial.print("#S|SENDK|[");
     Serial.print(itoa((pId), buffer, 10));
     Serial.print("&");
     Serial.print(itoa((potValue1), buffer, 10));
     Serial.print(" {TAB} ");
     Serial.print(itoa((potValue2), buffer, 10));
     Serial.print(" {DOWN} ");
     Serial.print(" {LEFT} ");
     Serial.println("]#");
     // wait up to 1000 ms for answer from Gobetwino, answer will be in serInString, answer is 0 if all is OK
     readSerialString(serInString, 1000);
     //Deal with answer here - omitted in this example
     delay(2000);
  }    
  // Now we have sent the 2 pot values 15 times, so save and close the XL sheet.
 Serial.print("#S|SENDK|[");
 Serial.print(itoa((pId), buffer, 10));
 Serial.print("& ");
 Serial.print("%Fg%Fa");  //=   ALT f   ALT g  = save and exit in danish Excell
 Serial.println("]#");
 // Wait 2 seconds for the save to finish
 delay(2000);
 // wait up to 1000 ms for answer from Gobetwino, answer will be in serInString, answer is 0 if all is OK
 readSerialString(serInString, 1000);
 // Next e-mail the XL sheet to someone
 Serial.println("#S|MXL|[]#");
 // wait up to 1000 ms for answer from Gobetwino, answer will be in serInString, answer is 0 if all is OK
 readSerialString(serInString, 1000);
} 

//read a string from the serial and store it in an array
//you must supply the array variable - will return if timeOut ms passes before the sting is read so you should
//check the contents of the char array before making any assumptions.
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++;
   }
}