Professional Documents
Culture Documents
CSE479-Review Exam - 230820
CSE479-Review Exam - 230820
B/ Thực hành
Lập trình viết ứng dụng
- Sử dụng Arduino, LED
- Điều khiển LED ON/OFF, chỉnh độ sáng theo chu kì
- Điều khiển LED thông qua Push Button
- Điều khiển dùng giao tiếp serial (thông qua Serial monitor)
- Giao tiếp giữa hai board Arduino, giữa Arduino và các thiết bị khác thông qua kết nối
Serial
1
School of CIT, EIU. Lecturer – Phan Van Vinh, Ph.D.
LED Control:
1) Write an Arduino program to turn on an LED connected to pin 13 for 1 second and
then turn it off for 1 second in an infinite loop.
2) Create an Arduino sketch that uses a push button to control an LED connected to
pin 10.
3) Write a program that gradually increases the brightness of an LED connected to
pin 9 using PWM.
4) Develop a code that blinks multiple LEDs in a sequence with a delay of 200ms
between each LED.
5) Implement a traffic light system using three LEDs (red, yellow, green) with
appropriate delays for each state.
6) Develop a program to control the brightness of an LED using a potentiometer
connected to an analog pin.
7) Create a program to read the state of a digital input and use it to control an LED on
a different pin.
8) Implement a code that uses millis() to blink an LED without using delay().
Serial Communication:
1) How do you initialize serial communication using the Arduino Serial library?
2) Develop an Arduino program that turns an LED on when receiving the character
'1' via serial communication and turns it off when receiving '0'.
3) Write a code that allows you to control the brightness of an LED connected to pin
9 using values received over serial communication (0-255).
4) Write a program that receives commands 'on' and 'off' over serial communication
to control the state of an LED connected to pin 7.
2
School of CIT, EIU. Lecturer – Phan Van Vinh, Ph.D.
5) Develop a sketch to send a "Hello, Arduino!" message over the serial port when a
button is pressed.
6) Create a remote-controlled LED system using serial communication where you
can switch between multiple LED patterns using different command codes.
7) Write a program that receives a numerical value over serial communication and
blinks an LED connected to pin 6 that number of times.
8) Create a bidirectional communication between two Arduinos using Serial
communication. Send a message from one Arduino, and display it on the other.
9) Write a program that reads analog sensor data from A0 and sends it over the serial
port to be displayed on the computer.