Difficult communication with processing

@PaulS, thanks for your answer. What you say is that the second part (else serial.write (L)) isn't essential?

No. What I mean is that, because you send data on every iteration of loop(), if the switch IS pressed or if the switch is NOT pressed, you will be sending a huge volume of data.

What you need to do is send one value when the switch BECOMES pressed, and another value when the switch BECOMES released. Many orders of magnitude less data that way.