Need someone to write me a simple code at least i think it’s simple

Hello I’m making a robot and i am willing to pay for what i need done it is aprently simple I’m new to coding but i need it for my school project
Things i need in code

  1. Starts with a press of a button
  2. Cues to start MP3 player for sound also starts my animation for the servos as well which i have the rotations and everything ready to be copied and pasted also using a
    .h file if that means anything the animation was done in blender.(cant have any delay between animation and music)(animation was programmed to music)
  3. Just need to end after animation and music is done and be able to start again with a press of a button
    Board I’m using is a mega 2560 i believe is the number and a MP3 player i found on Amazon since i was told by other people it was simple the most i can pay is $50 due to me being a kid if you have any questions let me know
    Thanks in advance

Ask the moderator to move this to Gigs and Collaboration.

first of all: welcome to the Arduino-user-Forums
It is really OK to ask for help her in the Arduino-Forum.
You will make important experiences in this process.

hm $30 - - - This is payed for half an hour of working as a professional software-developer. Even for a software-developer who has experience in programming moving servos it will take minimum multiple hours to get this working.

The reason is: You haven't yet given any information about

  • how many servos?
  • what kind of movements shall the servos do?
  • what do you expect as "input-procedure" to adapt the servo-moves to get in sync with the music?

So I guess paying a "professional" software-developper is not an option.

How much time do you have until the project should be finished?

How about asking at your school if some other student who has some experience in programming microcontrollers or is at least interested in it to collaborate with you?

How about you yourself learning programming? If you are wiling to put some own effort into learning you can ask as many questions as you like and you will get answers infinitely. If you just "lay back on your sofa" saying "can somebody make it work for me" you will get zero support.

It is not as easy as "Alexa please order the pizza I have ordered last week"

So to become a picture of your project you should describe your robot or even better upload pictures of it. And describe in detail what kind of moves the servos shall do.

There is a chance that you didn't thought about that. Well for kids this is pretty normal. They are in the pocess of learning how to realise projects.
The first step is to define the requirements in detail.

May I am allowed to ask what the learning-targets of this projects are?
Did you teacher say something about that?

best regards Stefan

1 Like

take a look into the WWW. I gues you will find a lot a projects doing that.

1 Like

Thank you so much for the feedback i guess I didn’t specify but i have all the servos done and everything in terms of having each potion that just needs to be copied and pasted at least i believe i do but there are 7 servos
I think what i need is someone to make the code outline so i can just copy and paste rotations into each one
Thanks anyways

You are working on a informatic project and in an informatic project the most needed thing is information.


Does that mean you continuos rotating servos that just need to rotate ?

I guess not. So you have to provide detailed information about how the servos shall move.

Without a detailed description of how the servos should move
nobody will ever be able to give you advice on how to program that.

It would be very helpful to have a picture how your robot looks like.

best regards Stefan


  The circuit:
  - LED attached from pin 13 to ground
  - pushbutton attached to pin 40 from +5V
  - 10K resistor attached to pin 40 from ground

  - Note: on most Arduinos there is already an LED on the board
    attached to pin 13.

// constants won't change. They're used here to set pin numbers:
const int buttonPin = 40;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn LED on:
    digitalWrite(ledPin, HIGH);

     * Your Servo code goes here

  } else {
    // turn LED off:
    digitalWrite(ledPin, LOW);

That is your start for your code. It uses a button wired to pin 40 of the Mega 2560 and turns on the Pin 13 LED when the button is pushed. Of note, I copied and pasted an edited version of the Button tutorial.

How do you plan to control the MP3 player with the start button? Will it be wired to the Arduino Mega?

Can you post a picture or link to the MP3 player that you have?

You have been the best help so far yes i Olán on wiring the mp3 to the mega 2560 do you just copy and paste this in sorry I’m née and have no idea

nope i have the rotations in numbers and just ready to be copied and pasted in their

I came to the conclusion it's better to stop the support here.

1 Like

wow that's rude geez I'm just new give me a break please

Have you loaded code into the Mega2560? Did you wire a button to pin 40?

I am sorry that synching servos to music is beyond my understanding level at this time.

Please copy and paste the numbers in here. We will, of course, need to know what the numbers mean. I assume that each position will have seven numbers to represent the positions of each of the seven servos. Are the time intervals between positions a fixed constant or is there timing information in the numbers?


All the numbers are i digital arrays for each servo they are not all together

I realise you are new around here and maybe don't understand how it works. By way of explanation, the reason that comment was made is because you seem to be "using" people (or at least have that attitude). If you want help, it is better to make an attempt yourself, and then ask for help when you run into difficulty. Showing that you've made an effort will buy you a lot of good will. Asking someone else to make that effort will do the opposite.

If you really aren't interested in learning Arduino, and just want someone to develop the code for you, you'll need to offer a lot more than $50.

I apologize for that I tried for several hours and there's not enough videos on YouTube to help me understand and i understand its probably frustrating dealing with a new person sorry

1 Like

OK, so you have an array of unspecified type and length for each servo. Something like:

const byte Servo1Positions[] = { a whole bunch of numbers};
const byte Servo2Positions[] = { a whole bunch of numbers};
const byte Servo3Positions[] = { a whole bunch of numbers};
const byte Servo4Positions[] = { a whole bunch of numbers};
const byte Servo5Positions[] = { a whole bunch of numbers};
const byte Servo5Positions[] = { a whole bunch of numbers};
const byte Servo7Positions[] = { a whole bunch of numbers};

const unsigned int NumberOfSteps =  sizeof Servo1Positions / sizeof Servo1Positions[0];

Then you just need to play out the positions:

    for (unsigned i=0; i<NumberOfSteps; i++)
      delayMicroseconds(22373);  // Adjust to get the duration right

For a first pass of the delayMicroseconds() number, divide the number of microseconds in the music by the number of steps in the animation.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.