
Learn How to Implement FreeRTOS on Arduino for Embedded Systems
"Discover the process of integrating FreeRTOS on Arduino for embedded systems through tasks handling sensors like photoresistors, ultrasonic sensors, and microphones. Explore practical projects like controlling RGB LEDs and designing a door security system. Enhance your knowledge of embedded systems with FreeRTOS. Get started now!"
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
CS4101 Introduction to Embedded Systems Lab 9: FreeRTOS Prof. Chung-Ta King Department of Computer Science National Tsing Hua University, Taiwan National Tsing Hua University
Introduction In this lab , we will learn How to link to FreeRTOS on Arduino How to create tasks in FreeRTOS 1 National Tsing Hua University
Link to FreeRTOS on Arduino There is a FreeRTOS implementation in Arduino IDE Go to Sketch -> Include Library -> Manage Libraries to open Arduino IDE Library manager 2 National Tsing Hua University
Link to FreeRTOS on Arduino In the Arduino IDE Library manager (from Arduino Version 1.6.8) look for the FreeRTOS Library Type: Contributed and Topic: Timing 3 National Tsing Hua University
Link to FreeRTOS on Arduino Under the Sketch -> Include Library , ensure that the FreeRTOS library is included in your sketch 4 National Tsing Hua University
Link to FreeRTOS on Arduino There are sample code under the File -> Examples -> FreeRTOS 5 National Tsing Hua University
Basic 1 Control a RGB LED using a photoresistor, an ultrasonic sensor, and a microphone. Measure the light using the photoresistor at 1 Hz to set the red input to the RGB LED accordingly. Measure the sound intensity using the microphone at 2.5 Hz to set the green input to the RGB LED. Measure the distance of an object using the ultrasonic sensor at 0.4 Hz to set the blue input to the RGB LED. 1) Implement the operations using the Arduino loop() 2) Implement the operations with FreeRTOS by creating three tasks to handle the three sensors 6 National Tsing Hua University
Basic 2 Design a door security system using a stepper motor, an ultrasonic sensor and a photoresistor. While the door is open, use the photoresistor every 0.5 second to detect whether an object is coming close. If so, then control the stepper motor to close the door. How long does it take to close the door? While the door is closed, use an ultrasonic sensor every 0.3 second to detect whether the object is at least 5 cm away. If so, control the stepper motor to open the door. When the open is opening, will you miss the deadline of checking the ultrasonic sensor every 0.3 second? Implement all functionalities using freeRTOS tasks. 7 National Tsing Hua University