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?

 

Have any questions?
A

Ashutosh

  Joined August 27, 2018      26

Monday at 04:18 PM

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 

Add a comment

No account needed. Your comment appears once a moderator has reviewed it.

Never shown publicly.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.