Blink 3

Here is the entire code:

int ledPin = 12;
//The pin of the microcontroller to which it is connected by the cable.

void setup() {
// set up all the LEDs as OUTPUT
pinMode (ledPin, OUTPUT);
}

void flash(int nf, int d){
//put the int is obligatory, the numFlashes is the number of flashes and the d is the milliseconds, you put flash because we want to
for(int i = 0; i(<)nf; i++){
//the name of this is "for loop" it is super important in computer science and what it consists of is to do one thing the predetermined number that you want.
digitalWrite (ledPin, HIGH);
//LED is in ON mode
delay (d);
//LED duration in ON mode digitalWrite (ledPin, LOW);
//LED is in OFF mode
delay (d);
//LED duration in OFF mode }
}

void sent(int nf, int d){
for(int i = 0; i(<)nf; i++){
digitalWrite (ledPin, HIGH);
delay (d);
digitalWrite (ledPin, LOW);
delay (d/3);
}
}

void loop()
you create a class of objects that is a function of variables.
flash(3,200);
milliseconds that it is in ON mode.
digitalWrite (ledPin, LOW);
//LED is in OFF mode
delay (400);
milliseconds that it is in OFF mode.

sent(3,600);
digitalWrite (ledPin, LOW);
delay (400);

flash(3,200);
digitalWrite (ledPin, LOW);
delay (1200);
}

By: Juan Antonio Calvete and Joel PoderĂ³s.