Simplest programing C on Arduino UNO

Today, let’s do a one LED flasher. Which we use the Arduino Software (IDE). Although, difficult to use, because the text mode. But it works completed, the most popular and free.

Step by step as 9 years boy learning.

1. Define symbol that human understand
“LED is ON” and “LED is OFF”
Figure 1
001-Define -symbol

2. However, since the LED changes from “ON” to “OFF” very quickly. The human can not see it.

We need to delay the LED ON longer for 1 second
Figure 2
002-delay

3.We start with programing, add a delay and “LED is ON”.
The system will always work from the top to down.
Figure 3
003-start-programing

4. From text that human understanding, converted to the code of the program. We have to remember it, calm down, if it would be easier to use.
LED is ON ==> digitalWrite(13,HIGH);
LED is OFF ==> digitalWrite(13,LOW);
Delay is 1 S ==> delay(1000);
Figure 4
code-program

5. Instead code in the function chart of Figure 3.
LED is ON ==> digitalWrite(13,HIGH);
Delay is 1 S ==> delay(1000);
LED is OFF ==> digitalWrite(13,LOW);
Delay is 1 S ==> delay(1000);
LED is NO ==> digitalWrite(13,HIGH);
Figure 5
005-Instead-code-chart

First Programing Arduino
Then, we open the Arduino IDE which we download from www.arduino.cc
– Click menu to New. There is As Figure 6

Arduino-IDE

In section 1, “put your setup code here, to run once:”
– To setup value! We need the pin 13 as output.
– Type the code: pinMode(13,OUTPUT);

In section 2, “ put your main code here, to run repeatedly:
To type all code below.

  1. void setup() {
  2.  
  3.   pinMode(13, OUTPUT);
  4.  
  5. }
  6.  
  7. void loop() {
  8.  
  9.   digitalWrite(13, HIGH);
  10.   delay(1000);
  11.   digitalWrite(13, LOW);
  12.   delay(1000);
  13.  
  14. }

When typing the code and see a mess, click the option Autoformat as Figure 7.
Autoformat

Next, when you’re done typing. Click at Sketch > Verify/Compile. It will be done for no error.
As Figure 8

Verify-Compile

Then, apply usb port to computers

Finally, Click to Sketch>Upload code to the arduino board. As Figure 9
Upload code
We are seeing LED pin 13 on board blink, as code programing.which we can change time as delay code.

I hope you will do this like me. Start, write code is not as difficult as we thought.

           Eleccircuit highly recommends EasyEDA for PCB design and order

Low Cost & Fast PCB Prototypes - EasyEDA

Only $8.21 for 10 pcs, 2-Layer 100x100mm PCBs, 2-3 days delivery