Arduino Using MPLAB X

Intro: 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

    • Tiny Home Contest

      Tiny Home Contest
    • Metalworking Contest

      Metalworking Contest
    • Audio Contest 2018

      Audio Contest 2018

    Discussions

    0
    None
    wold630

    2 years ago

    So simple!