Arduino Using MPLAB X

Published

Introduction: Arduino Using MPLAB X

I will be making a simple code to blink a LED using Arduino.

Step 1: Dealing With LED Using Arduino

We will begin by declaring the output pin

pinMode(ledPin, OUTPUT)

Make sure that all the code below is in the void loop

digitalWrite(ledPin, HIGH);

This statement is used to turn ON the LED

digitalWrite(ledPin, LOW);

This statement is used to turn off the LED

Finally we can put delay(n), where n can be any number depending on the time that we want to run to stop the LED.

Step 2: Sample Code

digitalWrite(ledPin, HIGH);

delay(5000);

digitalWrite(ledPin, LOW);

delay(5000);

Share

    Recommendations

    • Oil Contest

      Oil Contest
    • Casting Contest

      Casting Contest
    • Woodworking Contest

      Woodworking Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    Comments