codi 2

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 :

    
    // C++ code Introducing variables for ledPins and durations.
//

const int ledPin=8;// using const 

const int dot=200; // the constant dot = 200  millisecond(s)

const int dash=600; // the constant dash = 600  millisecond(s)

void setup()
{
  pinMode(8, OUTPUT);
}

void loop()
{
  digitalWrite(8, HIGH); // 
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dash); // Wait for 600 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dash); // Wait for 600 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dash); // Wait for 600 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, LOW);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, HIGH);
  delay(dot); // Wait for 200 millisecond(s)
  digitalWrite(8, LOW);
  delay(dash); // Wait for 600 millisecond(s)
}