We are about to switch to a new forum software. Until then we have removed the registration on this forum.
First.... what does this mean? While doing a search I see this error a lot attached to a variety of different sketches.
second I am doing a serial feed read from temperature sensors on an arduino. It runs fine for awhile then throws the nullpointerexception.
steve
Answers
when a var is null and you wanna use it it throws this
e.g. you load an image which is not there and then you want to show it.
better
please read on here, section exceptions:
http://wiki.processing.org/w/Technical_FAQ
That happens when we try to access a property from a
null
reference. Using the dot operator for example:http://processing.org/reference/dot.html
you wrote
I think when the speed of the sensor and your PC don't match, the sensor value can be null (there wasn't a sensor value, buffer was empty) - hence the error
to avoid this, check your sensor data if they are null:
also look at try---catch....
See Technical FAQ in the Exceptions section for general explanations, and more specifically: Why do I get a NullPointerException?