Servos and ESCs get the same kind of signal, 50Hz signal. The pulse signal varies from 1ms to 2ms, with 1ms represents the motor off completely and 2ms is the maximum speed and anything between is also varying speed.so technically what I am trying to do is, for the first press of the button the signal would be 1500 (1250+250) so middle speed, second press it would be 1750 (1500+250) 3/4 of the max speed and for the third click, it would be 2000 (1750+250).

I am familiar with and understand all that and in your code you have instances of writing correctly to m1 like this

the m1.writeMicroseconds(1000); is for when nothing is pressed, so the motor speed would go to zero (1000), and the myPulsetime = (mypulseTime + pulseIncrement); is for the variation of speed (the thing is that can't have a potentiometer because this project is going underwater, so I just wanted 1 button that would vary through 3 speeds) I put the m1.write because I didn't know what function or whatever I should use.

myPulsetime = (mypulseTime + pulseIncrement);after which myPulsetime has a value.

As an aside, how would you print that value ?

Rather than printing it you want to write the value of myPulsetime to m1. You know how to write 1000, so substitute myPulsetime for 1000 in the command and you will have written the value of myPulsetime to m1.

I do not want to simply give you the answer because it is important to think for yourself

Please do not send me PMs asking for help. Post in the forum then everyone will benefit from seeing the questions and answers.

However, I kind of got over that version so what do you think about this code? what should I connect the A2 to ground/ 5 volts? It wasn't written by me I just edited it a bit.thanks for the help, man I really appreciate it