float speed; float x_current = 0; void angleMove(float x, float y, float angle, float armLength, float speed) { clearDisplay(); arduino.digitalWrite(right, arduino.HIGH); noFill(); strokeWeight(20); // Controls thickness of blue border stroke(color(0, 0, 255)); beginShape(); // Draws shape vertex(convertXCoord(x - x_current + armLength*cos(angle*PI/360)), convertYCoord(y + armLength*sin(angle*PI/360))); vertex(convertXCoord(x - x_current), convertYCoord(y)); vertex(convertXCoord(x - x_current + armLength*cos(angle*PI/360)), convertYCoord(y - armLength*sin(angle*PI/360))); endShape(CLOSE); if (x_current < displayWidth-menu.width){ x_current = x_current + 1*speed; } else { x_current = 0; } }