How to make a simple animation of a heartbeat monitor

Hello everyone,

I’m very lost! I need to make a simple animation of a heartbeat monitor. The default setting should just be a simple horizontal line in the middle of the screen and when key pressed the line should take a jump as if it was a heartbeat.

I don’t know what to do from this point:
void setup() {
size(400, 400);
}

void draw() {
background(255);
line(0, height/2, 400, height/2);

}

Would any of you help me get further with the coding?
Thanks in advance!

Best Julie

Hello,

There are lots of resources and examples here to get you started:

Start simple… plot some points in a for loop and build on that.

To get you started:
https://processing.org/reference/point_.html
https://processing.org/reference/for.html

:)