'serialWrite' was not declared in this scope
It should be Serial.write to notice the period.

Which would make your code:

int buttonPin
void setup ()
{
    Serial.begin(9600);  # There was an error on this line as well
    pinMode (buttonPin, INPUT);
}
void loop ()
{
    if (digitalRead(buttonPin) == HIGH)
    Serial.write('H');
    else
    Serial.write('L');
    delay(1000);
}


Have a look at https://www.arduino.cc/en/Serial/Write for a complete example