Blinking Led Lab 1
Blinking Led Lab 1
INTRODUCTION:
Embedded systems play a vital role in various technological applications, requiring efficient
programming and hardware integration. This lab experiment focuses on implementing a basic blinking
LED application on Arduino and STM32 Nucleo boards. By comparing the programming syntax,
libraries, and functionalities of both platforms, participants gain practical experience in embedded
systems development.
OBJECTIVES:
o Understand the basic concepts of embedded systems programming.
o Compare the programming methodologies of Arduino and STM32 Nucleo boards.
o Implement a simple blinking LED application on both platforms.
o Analyze the differences in code syntax and execution between Arduino and STM32
platforms.
APPARATUS:
o Arduino board (e.g., Arduino Uno)
o STM32 Nucleo board (e.g., Nucleo-F303RE)
o LEDs
o Jumper wires
o Breadboard
PROCEDURE:
o Connect the Arduino board to the computer using a USB cable.
o Write the code for the blinking LED application using the Arduino IDE.
o Upload the code to the Arduino board and observe the LED behavior.
o Disconnect the Arduino board and connect the STM32 Nucleo board to the computer.
o Write the code for the blinking LED application using STM32CubeIDE.
o Compile the code and flash it onto the STM32 Nucleo board.
o Observe the LED behavior and compare it with the Arduino board.
RESULTS:
The code configures pin 12 as an output pin and creates a blinking effect by toggling the LED state with
specific delays.
The code toggles the state of the built-in LED (LD2) on the STM32 Nucleo board using the HAL GPIO
Toggle function with a delay of 1000 milliseconds.
The blinking LED application was successfully implemented on both Arduino and STM32
Nucleo boards. While the basic functionality remained the same, there were differences in code
syntax and library usage between the two platforms. The Arduino code utilized functions such as
digitalWrite() and delay(), whereas the STM32 code employed HAL (Hardware Abstraction
Layer) functions like HAL_GPIO_TogglePin() and HAL_Delay().
DISCUSSION AND ANALYSIS:
The experiment highlighted the versatility of embedded systems programming and the
importance of selecting the appropriate platform based on project requirements. Arduino boards
offer simplicity and ease of use, making them ideal for beginners and rapid prototyping. On the
other hand, STM32 Nucleo boards provide advanced features and performance, suitable for
complex projects requiring real-time processing and high-speed communication.
CONCLUSION:
In conclusion, the lab experiment provided valuable insights into embedded systems
programming using Arduino and STM32 Nucleo boards. By implementing a basic blinking LED
application, participants gained practical experience in writing code and understanding the
differences between Arduino and STM32 platforms. Moving forward, further exploration and
experimentation with advanced features and peripherals of both boards can deepen
understanding and enhance skills in embedded systems development.