Adding a moving object on command that is read through serial port

I was wondering if anyone could help me with processing code where processing is reading the value of a button (on or off) and I want to have an ellispe that is added when the button is pressed down. Everytime ive tried to code it, the ball is added and when i take my finger off the button (off) the ellipse then is removed. How can I code it so that the ball stays?

 

Remove the line that updates the background. You should have line like

 background(0);

inside your draw() loop just remove it and your ellipse will not be removed after you take your finger off. Providing your code here would make it more easy to help you 

  Joined August 27, 2018      25
Monday at 04:18 PM