0% found this document useful (0 votes)
50 views

Hello Arduino Experiment MODULE 4

The document introduces Arduino and discusses the origins and significance of the phrase "Hello World". It then provides code to print "Hello Arduino!" to the serial monitor using Arduino IDE. The code is run successfully, printing "Hello Arduino!" to the serial port every second. Finally, it shows how to create the same program using the graphical programming languages MBlock and Mixly.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Hello Arduino Experiment MODULE 4

The document introduces Arduino and discusses the origins and significance of the phrase "Hello World". It then provides code to print "Hello Arduino!" to the serial monitor using Arduino IDE. The code is run successfully, printing "Hello Arduino!" to the serial port every second. Finally, it shows how to create the same program using the graphical programming languages MBlock and Mixly.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Hello Arduino !

Introduce to Arduino
A programmer loves calligraphy after retirement, one day, he is suddenly in aesthetic
mood after meal, so he prepares "the Four Treasures of Study",writing brush, ink stick, ink
slab and paper, grinds ink, spreads paper and lights a good sandal, quite a Wang Xizhi
demeanor and Yan Zhenqing manner. Composed for a moment, then he splashed ink,
Earnestly writes down the words: "hello world!". Why programmers are so keen on this words?
The inception of "Hello world" dates back to 1972, Bell Laboratory’s famous researcher Brian
Kernighan firstly used it(program) when he was writing "B Language tutorials and guidance
(Tutorial the Introduction to the Language B)" , this is the earliest known record at present
when "hello" and "world" are used together in a computer work . Then, in 1978, he used this
sentence pattern "hello, world" again in C Language bible "The C Programming Language" ,
co-authored with Dennis Ritchie, as the first program in the opening ceremory . In this
program, the output of the "hello, world" are all lower-case, without an exclamation point, a
comma followed by a space. Although the initial form almost failed to survive after that, from
then on, "hello, world" became a tradition of the program world to greet the outside. "Hello
Arduino!", without exception, also became the first program in the tutorial.
Hardware Connection
There is a Atmega16u2 USB serial port on Arduino uno board , so the first program
doesn't need to connect to other equipments, only requires Arduino UNO to connect PC with
a USB cable directly.
Code
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("Hello Arduino !");
delay(1000);
}

Run the program and observe the experimental results


1. Connect Arduino UNO to the computer through USB;
1
2. Open the Arduino IDE, and click "file -- open -- select helloarduino.ino -- open", as shown in figure 3.1.1.

Figure 3.1.1 select file diagram


1) open the Arduino IDE and click "tools -- port – COM80(different board have different
board number )", as shown in figure 3.1.2

Figure 3.1.2 port selection


2
2) click on "tools -- programming –AVRISP mkII"

Figure 3.1.3 programmer selection


3) click "upload button" to start the upload program

3
Figure 3.1.4 upload program
4) start uploading the program, wait for a while, and there will be a prompt of "successful
uploading" in the lower left corner, showing that the program has been successfully
recorded.See figure 3.1.6.

Figure 3.1.5 burning

4
figure 3.1.6 burning is completed
5) open the serial port monitor, as shown in figure 3.1.7 and figure 3.1.8, and set the baud
rate to 9600 (the baud rate should be consistent with the code,Otherwise, the printing
contents will appear garbled code), and you will see the serial port end continuously print
"Hello Arduino!

5
Figure 3.1.7 serial monitor switch

Figure 3.1.8 serial port printing interface

6
Mblock graphical programming program
Programming a serial port print Hello Arduino with mBlock!The program is shown in the
following figure:

Figure 4.1.1

MagicBlock graphical programming program

Mixly graphical programming program

You might also like