I'm working on a project with bluetooth communication with a 'robot' (conducted by an arduino microcontroller).
I would like the application (with processing) to keep a log of the activities of the robot.
This log would show images of the activities.
Now, I've made another program to implement the 'tactic' that I'd use.
This is a program with 4 buttons, and when these buttons are clicked, the program should show a log (in a rectangle) with the buttons that have been pressed.
I've thought of some possibilities to do this. I think this is the right one. But I've been having a 'nullPointerException' Error.
I, first of all, don't know what this error means and why this program won't work.
boolean overRect(int x, int y, int width, int height) { if (mouseX >= x && mouseX <= x+width && mouseY >= y && mouseY <= y+height) { return true; } else { return false; } } }
class RectButton extends Button { RectButton(int ix, int iy, int isize, color icolor, color ihighlight) { x = ix; y = iy; size = isize; basecolor = icolor; highlightcolor = ihighlight; currentcolor = basecolor; }
boolean over() { if( overRect(x, y, size, size) ) { over = true; return true; } else { over = false; return false; } }