Go Down

Topic: Problem sending live data to arduino using firmata (Read 1 time) previous topic - next topic


Apr 18, 2014, 05:37 am Last Edit: Apr 18, 2014, 05:40 am by Sahoya Reason: 1
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


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?
Code: [Select]

Code: [Select]
String [] site = loadStrings(url);
How many strings are in this array?

Code: [Select]
String [] list = split(site[0], ';');
How many strings are in this array?

Code: [Select]
    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?

Code: [Select]
  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);

  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.



Code: [Select]
    if (ID.equals("var avail=\"HESLBAOA01")
    ) // on basement floor


Code: [Select]

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.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131