serial.write if condition
You declare incomingchar as a char. In your if you compare that char to a string (double quotes) incomingchar=="g". I think you want to compare it to a char (single quotes) like this:

if ( incomingchar == 'g' ) {
  // do something
}