"Step-less" activation of LEDs and movement of servo

Hello!

I'm an absolute rookie and just trying to finish up on my first project which could use some finishing:

here's the deal:
I was given the task to design a machine that children would have to stick a card in to "activate" this machine. This should be done by a remote control (hidden in the pocket of some adult).

Here's a little video of a first rough version:

The only trouble i'm having, is that i find the movement of the needle too "chopped up"
So here's my question:
is there a simple command to make the movement of the needle, the activation of the led's (all controlled by a separate pin) and ideally also the pitch of the tone played more "smooth"? So the needle moves slowly to the other end, while the pitch of the note played slowly becomes higher, while the led's turn on one after the other?

Or maybe at least for the needle and the note played, as those are not in need of controlling several pins?

Hope I'm not stealing anyones time, but i had the feeling there might be a simple solution to this that i'm missing. By now my code is only made up of a lot of delay() commands and stepwise activation of the led's/position of servo/tone played...

Thanks in advance,
Andi

Hard to say because you have not posted a schematic nor any code please read this How to use this forum

Is that needle a servo? If so you can make the movement a lot finer simply by moving it in smaller amounts.

int LED1=2;
int LED2=3;
int LED3=4;
int LED4=5;
int LED5=6;
int LED6=7;
int LED7=8;
int LED8=9;
int LED9=10;

int RF=12;
int buttonState = 0;

#include <Servo.h>
#include "pitches.h"

Servo servoblau;

void setup() {
  // put your setup code here, to run once:

pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
pinMode(LED6, OUTPUT);
pinMode(LED7, OUTPUT);
pinMode(LED8, OUTPUT);
pinMode(LED9, OUTPUT);
pinMode(RF, INPUT);

servoblau.attach(13);

}

void loop() {
buttonState = digitalRead(RF);
if (buttonState == HIGH) {
servoblau.write(0);
digitalWrite(LED1, HIGH);
tone(11, NOTE_C4, 500);
delay(500);
servoblau.write(10);
digitalWrite(LED2, HIGH);
tone(11, NOTE_CS4, 450);
delay(450);
servoblau.write(20);
digitalWrite(LED3, HIGH);
tone(11, NOTE_D4, 400);
delay(400);
servoblau.write(30);
digitalWrite(LED4, HIGH);
tone(11, NOTE_DS4, 350);
delay(350);
servoblau.write(50);
digitalWrite(LED5, HIGH);
tone(11, NOTE_E4, 300);
delay(300);
servoblau.write(70);
digitalWrite(LED6, HIGH);
tone(11, NOTE_F4, 250);
delay(250);
servoblau.write(90);
digitalWrite(LED7, HIGH);
tone(11, NOTE_FS4, 200);
delay(200);
servoblau.write(145);
digitalWrite(LED8, HIGH);
tone(11, NOTE_G4, 150);
delay(150);
servoblau.write(180);
digitalWrite(LED9, HIGH);
tone(11, NOTE_GS4, 100);
delay(50);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
digitalWrite(LED6, LOW);
digitalWrite(LED7, LOW);
digitalWrite(LED8, LOW);
digitalWrite(LED9, LOW);
delay(50);

digitalWrite(LED7, HIGH);
digitalWrite(LED8, HIGH);
digitalWrite(LED9, HIGH);
tone(11, NOTE_A4, 300);
delay(300);

digitalWrite(LED7, LOW);
digitalWrite(LED8, LOW);
digitalWrite(LED9, LOW);
digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
tone(11, NOTE_D4, 150);
delay(150);

digitalWrite(LED4, HIGH);
digitalWrite(LED5, HIGH);
digitalWrite(LED6, HIGH);
tone(11, NOTE_FS4, 150);
delay(150);

digitalWrite(LED7, HIGH);
digitalWrite(LED8, HIGH);
digitalWrite(LED9, HIGH);
tone(11, NOTE_A4, 300);
delay(200);
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
digitalWrite(LED6, LOW);
digitalWrite(LED7, LOW);
digitalWrite(LED8, LOW);
digitalWrite(LED9, LOW);
delay(100);

digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
tone(11, NOTE_D4, 150);
delay(150);

digitalWrite(LED4, HIGH);
digitalWrite(LED5, HIGH);
digitalWrite(LED6, HIGH);

tone(11, NOTE_FS4, 150);
delay(150);

digitalWrite(LED7, HIGH);
digitalWrite(LED8, HIGH);
digitalWrite(LED9, HIGH);
tone(11, NOTE_A4, 300);
delay(200);

digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
digitalWrite(LED6, LOW);
digitalWrite(LED7, LOW);
digitalWrite(LED8, LOW);
digitalWrite(LED9, LOW);
delay(100);

digitalWrite(LED1, HIGH);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, HIGH);
tone(11, NOTE_D4, 150);
delay(150);

digitalWrite(LED4, HIGH);
digitalWrite(LED5, HIGH);
digitalWrite(LED6, HIGH);

tone(11, NOTE_FS4, 150);
delay(150);

digitalWrite(LED7, HIGH);
digitalWrite(LED8, HIGH);
digitalWrite(LED9, HIGH);
tone(11, NOTE_A4, 500);
delay(500);

digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
digitalWrite(LED6, LOW);
digitalWrite(LED7, LOW);
digitalWrite(LED8, LOW);
digitalWrite(LED9, LOW);
servoblau.write(0);

}
else {
digitalWrite(LED1, LOW);
digitalWrite(LED2, LOW);
digitalWrite(LED3, LOW);
digitalWrite(LED4, LOW);
digitalWrite(LED5, LOW);
digitalWrite(LED6, LOW);
digitalWrite(LED7, LOW);
digitalWrite(LED8, LOW);
digitalWrite(LED9, LOW);
noTone(11);
}

}

here's the code. sorry for being a messy one.

that needle is a servo, yes. i thought about using smaller angles as well, but i hoped to find a simpler solution than blowing up the code unnecessarily with commands moving the servo at one degree at a time.

here's the code. sorry for being a messy one.

It is not messy but it is turgid. That is you are writing the same thing over and over. You need to learn how to use loops that will considerably shorten the code.

but i hoped to find a simpler solution than blowing up the code unnecessarily with commands moving the servo at one degree at a time.

Yes it will blow up turgid code, and that is another reason for learning how to use loops, the servo motion can be as smooth as you like with no extra lines of code if it is moved in a loop.

This bit of code:-

servoblau.write(90);
digitalWrite(LED7, HIGH);
tone(11, NOTE_FS4, 200);
delay(200);
servoblau.write(145);

moves the servo first to an angle of 90 degrees and then moves it to an angle of 145 in 200mS, so that is 55 degrees in 200mS or 3.6mS per degree. I am assuming this time is not very critical so lets say you have 4mS per degree. You could use code like this:-

digitalWrite(LED7, HIGH);
tone(11, NOTE_FS4, 200);
for(int angle=90; angle < 145; angle++){
   servoblau.write(angle);
   delay(4);
}

Thanks! That basically solved the issue... I'll try to dig deeper into the loop thing now