Can you please format your code as per:
https://discourse.processing.org/faq#format-your-code
There are resources (tutorials, references, examples) here:
https://processing.org/
Take a look at the resources related to serial and you will find your answer there.
:)