# I am attempting a serial communication with my Arduino

**URL:** <https://discourse.processing.org/t/i-am-attempting-a-serial-communication-with-my-arduino/47521>\
**Category:** Electronics (Arduino, etc.)\
**Created:** [November 9, 2025, 7:49pm UTC](https://discourse.processing.org/t/i-am-attempting-a-serial-communication-with-my-arduino/47521 "2025-11-09T19:49:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![electron59](https://avatars.discourse-cdn.com/v4/letter/e/7ea924/32.png) [@electron59](https://discourse.processing.org/u/electron59)\
**Post date:** [November 9, 2025, 7:49pm UTC](https://discourse.processing.org/t/i-am-attempting-a-serial-communication-with-my-arduino/47521/1 "2025-11-09T19:49:53Z")

</div>

I am getting an error stating the class “string” does not exist and in same block variable “port” and variable “ lastTime” does not exist .

I believe it is something to do with a serial port list for the Arduino is not correct but since I am a beginner I do not know how to correct this .

Any help appreciated

---

<div class="post-metadata">

**Author:** ![svan](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svan](https://discourse.processing.org/u/svan)\
**Post date:** [November 9, 2025, 8:43pm UTC](https://discourse.processing.org/t/i-am-attempting-a-serial-communication-with-my-arduino/47521/2 "2025-11-09T20:43:33Z")

</div>

Any way to see the code that’s causing problems?

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [November 9, 2025, 11:20pm UTC](https://discourse.processing.org/t/i-am-attempting-a-serial-communication-with-my-arduino/47521/3 "2025-11-09T23:20:48Z")

</div>

Hello @electron59,

Welcome to the forum!

This is a good place to start:  
_[Welcome to the Processing Foundation Discourse](https://discourse.processing.org/t/welcome-to-the-processing-foundation-discourse/8)_

The _Guidelines - Asking Questions_ is an excellent guide!

There are resources (tutorials, references, examples and more) here:  
_[https://processing.org/](https://processing.org/)_

Take advantage of the search in the forum and on the main page.

Try to build your code in steps!

Save each working version and then save it as a new version to continue.  
MySketch\_1\_0\_0  
My Sketch\_1\_0\_1  
And so on…

Code is not forgiving!  
Pay attention to details and learn from it.  
Perseverance and taking advantage of the resources and tools available to you will pay off in the long run.

A snippet of code to get you started:

```auto

// Uncomment the String declarations and see what happens!
// Try all the combinations! Each one and both.

// Declare globally:
//String string = "global"; // Declares string

void setup()
  {
  // Declare locally:
  //String string = "setup";
  
  // Trying to print string but it was note declared!
  println(string); 
  }  

```

This is the error I get initially:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/8/d/8d95524465c08441b4b36a30b35911fc57463064.png)

This is the error when I click on the underlined:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/2/7/27bb915f8d17468504b709868efa01b173c9d6a7.png)

It does not exist because I did not declare it globally or locally!

And have fun!

`:)`

---

<div class="post-metadata">

**Author:** ![RichardDL](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@RichardDL](https://discourse.processing.org/u/RichardDL)\
**Post date:** [November 11, 2025, 12:28pm UTC](https://discourse.processing.org/t/i-am-attempting-a-serial-communication-with-my-arduino/47521/4 "2025-11-11T12:28:31Z")

</div>

Hi @elextron59, You might like this [example](https://discourse.processing.org/t/processing-and-arduino-serial-example/31650) I posted as an almost sure way to get comms running.
