Professional Documents
Culture Documents
Arduino Lab Manual
Arduino Lab Manual
MANUAL
LAB 1: LED BLINKY
I. Install CH340 Driver
• Windows 7/10
• Mac OSX
o v10.10.5 (Yosemite)
o v10.11.6 (El Capitan)
o v10.13.0 (High Sierra)
o v10.14.5 (Mojave)
• Linux
o Raspbian Stretch (11-13-2018 release) for the Raspberry Pi
o Raspbian Buster (2019-07-10 release) for the Raspberry Pi
o Ubuntu v18.04.2, 64-bit
These operating systems have the CDC drivers pre-installed, which means you shouldn't need to
install any extra software. However, there are a wide range of operating systems out there, so if
you run into driver problems, you can get the archived drivers linked below:
The CH340 is made by WCH. You can find the latest version of their drivers here, but most of
their pages are in Mandarin. If you use a Chrome web browser, you should have the option to
have the web page translated.
Reference: https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all
2. Modify the program in order to turn on the LED for 2 seconds and then turn it off for 3
seconds. Provide your source code in following:
V. Exercise
1. Connect more LED to other pins and do some led animations. You can arrange the LEDs
in a beautiful shape for this exercise. Currently, the build-in LED is connected to Pin 13
of the Arduino. If your LED is connected to Pin 1 for instance, following codes are
required:
2. There is a motor which three different LEDs, representing for Red, Yellow and Green.
These motors are connected to pins numbered 10 (Yellow), 11 (Green) and 12 (Red) of
the Arduino Uno platform.
Where: Red: the motor is stop 5s, Yellow: left motor move 5s, Green: right motor move
5s
3. Write and run a program that make buzzer using Arduino
LAB 2: SERIAL COMMUNICATION
VI. Introduction
In data transmission, serial communication is the process of sending data one bit at a time,
sequentially, over a communication channel or computer bus. This is in contrast to parallel
communication, where several bits are sent as a whole, on a link with several parallel channels.
In this lab, a serial communication is used for data transmission between the Arduino board and a
computer or other devices. All Arduino boards have at least one serial port (also known as a UART
or USART) named Serial. It communicates on digital pins 0 (RX) and 1 (TX) as well as with the
computer via USB. Thus, if you use these functions, you cannot also use pins 0 and 1 for digital
input or output.
Finally, click on Tools, select Serial Monitor as showed Figure 8 and then, a PC terminal will be
opened as depicted in Figure 9. Please make sure that the speed of the terminal is set to 9600
baud. Then, you can see the result on the terminal!!!
void loop() {
if(Serial.available())
{
char temp = Serial.read();
Serial.print("I received: ");
Serial.println(temp);
}
}
Figure 10: The result when typing letter A in the box, then click on Send button
After uploading to the board, you can open the terminal again by clicking on Tools/Serial Monitor.
The results can be found in Figure 10
IX. Exercise
1. Implement a short program to make the LED connected to pin 13 turn on if a character O
is received. Other characters, the LED is turned off.
Hint: Use the if statement: if(temp == ‘O’){ …. } else {….}
2. Implement a short program to make the LED connected to pin 13 turn on if a character O
is received. However, the LED is turned off only when receiving character F