class System { // Variables int butS; //- the size of a button int spacing; //- the spacing between the two buttons int butIX; //- the x position of the button that will increase the servo angle int butIY; //- the position of the button that will increase the servo angle color butIC; //- the color of the button that will increase the servo angle Button b1; //- the button object that will increase the servo angle int butDX; //- the x position of the button that will decrease the servo angle int butDY; //- the position of the button that will decrease the servo angle color butDC; //- the color of the button that will decrease the servo angle Button b2; //- the button object that will decrease the servo angle int sliderX; //- the x position of the slider int sliderY; //- the y position of the slider int sliderH; //- the height of the slider color sliderC; //- the color of the slider Slider sl1; //- the slider object color btn1CharC; // Color for button 1's plus sign color btn2CharC; // Color for button 2's minus sign // Constructor System(int x, int y, int min, int max, String name, color sldC) { butS = 50; spacing = 10; butIX = x; butIY = y; butIC = color(0, 255, 255); butDX = butIX; butDY = butIY + butS + spacing; butDC = color(0, 255, 255); sliderX = x + butS + spacing; sliderY = y + butS + spacing; sliderH = 50; sliderC = sldC; btn1CharC = color(0, 255, 0); btn2CharC = color(255, 0, 0); b1 = new Button(butS, butIX, butIY, butIC, '+', btn1CharC); b2 = new Button(butS, butDX, butDY, butDC,'-', btn2CharC); sl1 = new Slider(sliderX, sliderY, 0, sliderH, sliderC, 0, min, max, name); } // draws both buttons, the slider, and the servoAngle text void render() { b1.render(); b2.render(); sl1.render(); } // if button 1 is pressed, then the slider should increase in width // if button 2 is pressed, then the slider should decrease in width void detectPresses() { if (b1.detectButtonPress()) { sl1.increase(); } else if (b2.detectButtonPress()) { sl1.decrease(); } } }