user70275: I am new to Arduino, please don't be harsh. I want to make a motor spin at every x amount of time (Lets say 10 minutes). Once the program is started, I want it to start the motor (stop after 10 seconds), and every 10 minutes, it continues the process. Is it possible to make it?,

user7508: The simplest option is to use delay() to implement the waits:
void loop() {
    turn_motor_on();
    delay(10000);  // 10 seconds
    turn_motor_off();
    delay(600000);  // 10 minutes
}

Since these long numbers may be difficult to read, you can make them
more readable by defining some units:
const unsigned long second = 1000;
const unsigned long minute = 60000;

Then you can for example delay(10 * minute);
Beware there is a trap if you try to do arithmetics with integer
literals. The following:
delay(10 * 60 * 1000);  // BUG!

will not work on most Arduinos, as the multiplications will be
performed on the int data type, which can only hold numbers up to
32,767. It is safer to use either explicitly typed constants (unsigned long is the appropriate type for delays) or integer literals typed with
the suffix UL (which stands for “unsigned long”).
Note that the Arduino will do no useful work while delaying. If you want
to do any kind of work during the delay, see the “Blink Without Delay”
Arduino example.

70275: <p>I am new to Arduino, please don't be harsh. I want to make a motor spin at every x amount of time (Lets say 10 minutes). Once the program is started, I want it to start the motor (stop after 10 seconds), and every 10 minutes, it continues the process. Is it possible to make it?,</p>
 7508: <p>The simplest option is to use <code>delay()</code> to implement the waits:</p>
<pre class="lang-cpp prettyprint-override"><code>void loop() {
    turn_motor_on();
    delay(10000);  // 10 seconds
    turn_motor_off();
    delay(600000);  // 10 minutes
}
</code></pre>
<p>Since these long numbers may be difficult to read, you can make them
more readable by defining some units:</p>
<pre class="lang-cpp prettyprint-override"><code>const unsigned long second = 1000;
const unsigned long minute = 60000;
</code></pre>
<p>Then you can for example <code>delay(10 * minute);</code></p>
<p>Beware there is a trap if you try to do arithmetics with integer
literals. The following:</p>
<pre class="lang-cpp prettyprint-override"><code>delay(10 * 60 * 1000);  // BUG!
</code></pre>
<p>will <strong>not</strong> work on most Arduinos, as the multiplications will be
performed on the <code>int</code> data type, which can only hold numbers up to
32,767. It is safer to use either explicitly typed constants (<code>unsigned long</code> is the appropriate type for delays) or integer literals typed with
the suffix <code>UL</code> (which stands for “unsigned long”).</p>
<p>Note that the Arduino will do no useful work while delaying. If you want
to do any kind of work during the delay, see the “Blink Without Delay”
Arduino example.</p>
