# Coding problems

**URL:** <https://discourse.processing.org/t/coding-problems/496>\
**Category:** Coding Questions\
**Created:** [May 29, 2018, 4:32pm UTC](https://discourse.processing.org/t/coding-problems/496 "2018-05-29T16:32:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Mikey](https://discourse.processing.org/u/Mikey)\
**Post date:** [May 29, 2018, 4:32pm UTC](https://discourse.processing.org/t/coding-problems/496/1 "2018-05-29T16:32:19Z")

</div>

ive been at this for a little bit now and im stuck and i dont know what to do.  
there is an error but idk where.

```auto
import processing.serial.*;
Serial myPort;
PImage logo;
int bgcolor=0;
void setup(){
 size(1,1);
 surface.setResizable(true);
  colorMode(HSB, 255);
  logo=loadImage("http://arduino.cc/arduino_logo.png");
  surface.setSize(logo.width, logo.height);
  println("Available serial ports:");
  println(Serial.list ());
  myPort=
   new Serial(this, Serial.list()[0], 9600);
}
void draw(){
  if(myPort.available()>0){
    bgcolor=myPort.read();
    println(bgcolor);
  }
  background(bgcolor,255,255);
image(logo, 0,0);
}
```

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [May 29, 2018, 5:24pm UTC](https://discourse.processing.org/t/coding-problems/496/2 "2018-05-29T17:24:57Z")

</div>

What error are you getting?

---

<div class="post-metadata">

**Author:** ![Mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Mikey](https://discourse.processing.org/u/Mikey)\
**Post date:** [May 29, 2018, 6:14pm UTC](https://discourse.processing.org/t/coding-problems/496/4 "2018-05-29T18:14:02Z")

</div>

its saying to type sting[] but idk how to use it or where to use it

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [May 29, 2018, 6:23pm UTC](https://discourse.processing.org/t/coding-problems/496/5 "2018-05-29T18:23:50Z")

</div>

Can you please post the exact text of the error message? Also please format your code by highlighting it and pressing the code button in the forum editor.

---

<div class="post-metadata">

**Author:** ![Mikey](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Mikey](https://discourse.processing.org/u/Mikey)\
**Post date:** [May 29, 2018, 6:27pm UTC](https://discourse.processing.org/t/coding-problems/496/6 "2018-05-29T18:27:45Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/58c65f5fb9431f7e67270f9d4bbc38af534d304d.png)

---

<div class="post-metadata">

**Author:** ![Kevin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kevin/32/2297_2.png) [@Kevin](https://discourse.processing.org/u/Kevin)\
**Post date:** [May 29, 2018, 6:31pm UTC](https://discourse.processing.org/t/coding-problems/496/7 "2018-05-29T18:31:32Z")

</div>

Honestly this is just a warning and can be ignored.

But the error is trying to explain itself to you. The `println()` function has a form where it takes an `Object...` vararg. By giving it an array, you’re giving it something other than exactly what it’s expecting. It will still work though.

You can get rid of the warning by casting to `Object[]`, like this:

```
println((Object[])Serial.list ());

```

But honestly I probably wouldn’t worry about this, especially because this line of code appears to be just for debugging anyway.
