Codi 3

In this project we are working with the micro conntroller MKR-1000



Here we will see an example video when the code is executed :



Here you have the code of the video example, he code is underlined :

    
   int Pin = 8;
int pulsadaCurta = 200; // a 200 millisecond delay to the short pulses
int pulsadaLlarga = 600;  // a 600 millisecond delay to the long pulses
 
 
 void setup() {
  pinMode(Pin, OUTPUT);
}
 
void loop() {
  // Letra S
SeqüènciaLetra(pulsadaCurta);  // pulsada curta = 200 millisecond delay
  delay(pulsadaCurta*3);
// Letra O
SeqüènciaLetra(pulsadaLlarga);   // pulsada llarga = 600 millisecond delay
  delay(pulsadaLlarga*3);
// Letra S
SeqüènciaLetra(pulsadaCurta);
delay(pulsadaCurta*3);
}
 
void SeqüènciaLletra(int Pulsada)
{
  for (int j=0;j;j++)
  {
digitalWrite(Pin, HIGH);
delay(Pulsada);           
digitalWrite(Pin, LOW);    
delay(Pulsada);
  }
}
}