Gobetwino Help Needed!

PeterH:
You don't seem to be looking for changes in the switch input, so it will continually take pictures as long as the switch input remains low.

You've included your sketch, but your question seems to be about how to get Gobetwino to do what you want. In that case you need to know whether the sketch is producing the output you expect (you can check by displaying the output in serial monitor), whether Gobetwino is executing the command you intended (turn on logging in Gobetwino) and whether that command is having the effect you intended.

Well I fairly late last night and worked on a chunk of it this morning. I was able to get all the errors out of Gobetwino. I set 1 command incorrectly but everything else is working in Gobetwino just as I need it to.

The problem is now with the SENDK command. For some reason it is not sending the hotkey to my webcam software. I noticed that if I left the program open Gobetwino would change the Process ID of the program so I had to add a line which would exit the program.

Now the problem exists within the program not registering the hotkey to take the snapshot. I'm not sure if it's the software or not. I can't find another piece of software which also lets me use hotkeys. Or maybe it's something in my code. I know the alt + f4 command is working so they are definitely being sent to the right program, it's just not taking the freaking snapshot!

Can anyone offer some suggestions.

Also I was looking in Gobetwino and the whole code with delays is preforming exactly how I need it to. The problem now only exists within the webcam software or the SENDK command.

**EDIT:**Maybe I need it to hold down the key for a few ms? Is there a way of doing that?

char buffer[5];

int select;
const int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);     

  Serial.begin(9600);

}


void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn LED on:    
    digitalWrite(ledPin, LOW);  
       
    
  } 
  else {
    // turn LED off:
  digitalWrite(ledPin,HIGH);
  
Serial.print("#S|LOGTEST|[");
Serial.print(itoa((0), buffer, 10));
Serial.println("]#");
 
 Serial.println("#S|WEBCAM|[]#");        // start Webcam software
  delay (5000);  // wait  5  seconds (max) for answer from Gobetwino (=porcess ID)
  
  Serial.println("#S|SENDK|[0&{HOME}]#");
  delay(5000);
   
   Serial.println("#S|SENDK|[0&%{F4}]#");
  delay(1000);
   
  }
  

}