Problem sending live data to arduino using firmata

I have five ellipses controlled by data driven from a string in my Processing file Called: "http://avail.mdx.ac.uk:8090/avail.js?".

The ellipses change size via map() function when the data in the string increases/decreases. I want to do the same for the LEDS. Hence, more LEDs turn on when more data is parsed through the serial communication and vice versa.

However, whenever I try I am greeted with this error 'java.lang.NullException.Pointer'

LED Set - Up:
5x5 vertical Grid (each row of leds controlled by each ellipse) - picture

  • PDE file attached

  • LED Set - Up attached

Led_Ellipse_Test.pde (2.16 KB)

However, whenever I try I am greeted with this error 'java.lang.NullException.Pointer'

There's more to the message than that.

Which port is the Arduino connected to?

How many ports are in this list?

Arduino.list()
String [] site = loadStrings(url);

How many strings are in this array?

String [] list = split(site[0], ';');

How many strings are in this array?

    String [] elm = list[i].split(":");
    String ID = elm[0];
    int total = int(elm[1]);
    int used = int(elm[2]);

How many strings are in elm?

{
  if (arduino.digitalRead(baFree) == Arduino.HIGH) {
    arduino.digitalWrite(LED1, Arduino.HIGH);
    int baVal=(int)map(baFree, 0, baMax, 5, 100);
  }
  else {
    arduino.digitalWrite(LED1, Arduino.LOW);
    ellipse(50, 50, 80, 80);
    fill(255);
  }

  text("Black - Free Computer Space", 260, 170);
  text("White - Used Computer Space", 260, 190);
}

What is this supposed to be doing? Code belongs in functions, not wherever you feel like putting it.

I have uploaded an updated version with no more error message, although still no LEDs turning on.

It is connected into Port 3. everything titled string all relates back to one string, which is "http://avail.mdx.ac.uk:8090/avail.js?"
. (url) is a variable which relates back to that string, noticed on line 23. Everything else is just 'splitting' and 'listing' the same string.

I have attached a .fzz schematic for a greater understanding of the physical form and a new .pde, which should also help understanding of my problem.

Thanks,

Led_Ellipse_Error2.pde (2.13 KB)

Fritzing 5x5 grid.fzz (8.21 KB)

    if (ID.equals("var avail=\"HESLBAOA01")
    ) // on basement floor

Why
is
the
)
on
a
new
line?

{println("-----------------------------------");

WhyIStheprintln()statementNOTonanewline?

If you can't make the effort to make your code readable (how hard is it to use Ctrl-T?), I'm not going to make the effort to read it.

You didn't answer any of my questions.