I want the "pick_one" and "pick_all" buttons to be inside another general button (like a file - or a new page in the interface) called "configuration" button. I've tried this code below but I get unexpected token: void error.
Is there a way to put the buttons inside of another button?
import controlP5.*; //import ControlP5 library
import processing.serial.*;
Serial port;
ControlP5 cp5; //create ControlP5 object
PFont font;
void setup(){ //Same as setup in arduino
size(900, 900);
port = new Serial(this, "COM4", 9600); //Change this to your port
cp5 = new ControlP5(this);
font = createFont ("Georgia Bold", 20);
cp5.addButton("PICK_ALL") //The button
.setPosition(100, 100) //x and y coordinates of upper left corner of button
.setSize(160, 150) //(width, height)
.setFont(font)
;
cp5.addButton("PICK_ONE") //The button
.setPosition(100, 400) //x and y coordinates of upper left corner of button
.setSize(160, 150) //(width, height)
.setFont(font)
;
cp5.addButton("CONFIGURATION") //The button
.setPosition(100, 400) //x and y coordinates of upper left corner of button
.setSize(160, 150) //(width, height)
.setFont(font)
;
}
void draw(){ //Same as loop in arduino
background(150, 0 , 150); //Background colour of window (r, g, b) or (0 to 255)
}
void CONFIGURATION() {
void PICK_ALL(){
port.write('t')
}
void PICK_ONE(){
port.write('l');
}}