0% found this document useful (0 votes)
7 views13 pages

Lesson Plan 1 Cylcle 1 Computer Science

Lesson Plan on Introdouction to Robotics

Uploaded by

Abraham Flowers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views13 pages

Lesson Plan 1 Cylcle 1 Computer Science

Lesson Plan on Introdouction to Robotics

Uploaded by

Abraham Flowers
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 13

Teacher’s Name: Submitted to: Subject: Month: (Due on Number of Classes

Day 1) Session:
Dr. Abraham HOD: Mrs. Carballo Computer Science 2 sessions 1J, 1C, 1H, 1N,
Elrington Flowers Dra. Seguro and Robotics 1S, 2N, 2H and
2S

Topic: Developing a C++ Program


Arduino parts and IDE
Subtopic: A Beginner’s C++ program
Structure of Simple C++ programs
Arduino Board and different types
Arduion components
Arduino IDE
Resources/Materials A Complete Guide to Programming in C++ Jones and Bartlett Publishers
Arduino for Beginners PDF
Power Point Presentation
Projector
Laptop
White board and marker
Vocabulary
References used by A Complete Guide to Programming in C++ Jones and Bartlett Publishers
Teacher

Competency Area 1. Appreciation of the sacred nature of the human person and Character Development;
2. Emotional Intelligence and Effective Communication Skill;
3. Computer literacy;
4. Collaboration;
7. Understanding of and Advocacy for Sustainable Human Development.
Competency Rubrics
Previous Students with no prior Computer Science experience should have basic logical thinking, problem-solving skills,
Knowledge and a general understanding of everyday electronics like circuits. Familiarity with using a computer and
opening applications will help them navigate the Arduino IDE and understand basic concepts related to
programming, electronics, and Arduino components. No specific programming or coding knowledge is
required.
Content Session 2
Arduino For Beginners

What Is Arduino?

Arduino is an open source programmable circuit board that can be


integrated into a wide variety of makerspace projects both simple
and complex.

This board contains a microcontroller which is able to be


programmed to sense and control objects in the physical world. By
responding to sensors and inputs, the Arduino is able to interact
with a large array of outputs such as LEDs, motors and displays.

Because of it’s flexibility and low cost, Arduino has become a very popular choice for makers and makerspaces
looking to create interactive hardware projects.

Arduino was introduced back in 2005 in Italy by Massimo Banzi as a way for non engineers to have access to a
low cost, simple tool for creating hardware projects. Since the board is open-source, it is released under a
Creative Commons license which allows anyone to produce their own board.

If you search the web, you will find there are hundreds of Arduino compatible clones and variations available
but the only official boards have Arduino in it’s name. In the next section, we’re going to discuss a few of the
Arduino boards available and how they differ from each other.

Types of Arduino Boards

Arduino is a great platform for prototyping projects and inventions but can be confusing when having to choose
the right board. If you’re brand new to this, you might have always thought that there was just one “Arduino”
board and that’s it. In reality, there are many variations of the official Arduino boards and then there are
hundreds more from competitors who offer clones. But don’t worry, we’re going to show you which one to start
with later on in this tutorial.

Below are a few examples of the different types of Arduino boards out there. The boards with the name
Arduino on them are the official boards but there are also a lot of really great clones on the market as well. One
of the best reasons to buy a clone is the fact they are generally less expensive than their official
Adafruit and Sparkfun for example, sell variations of the Arduino boards which cost less but still have the same
quality of the originals. One word of caution, be careful when buying boards from companies you don’t know

Arduino Uno

One of the most popular Arduino boards out there is


the Arduino Uno. While it was not actually the first
board to be released, it remains to be the most
actively used and most widely documented on the
market. Because of its extreme popularity, the
Arduino Uno has a ton of project tutorials and
forums around the web that can help you get started
or out of a jam. We’re big fans of the Uno because
of it’s great features and ease of use

Board Breakdown

Here are the components that make up an Arduino board


and what each of their functions are.

1. Reset Button – This will restart any code that is loaded


to the Arduino board
2. AREF – Stands for “Analog Reference” and is used to
set an external reference voltage
3. Ground Pin – There are a few ground pins on the
Arduino and they all work the same
4. Digital Input/Output – Pins 0-13 can be used for digital input or output
5. PWM – The pins marked with the (~) symbol can simulate analog output
6. USB Connection – Used for powering up your Arduino and uploading sketches
7. TX/RX – Transmit and receive data indication LEDs
8. ATmega Microcontroller – This is the brains and is where the programs are stored
9. Power LED Indicator – This LED lights up anytime the board is plugged in a power source
10. Voltage Regulator – This controls the amount of voltage going into the Arduino board
11. DC Power Barrel Jack – This is used for powering your Arduino with a power supply
12. 3.3V Pin – This pin supplies 3.3 volts of power to your projects
13. 5V Pin – This pin supplies 5 volts of power to your projects
14. Ground Pins – There are a few ground pins on the Arduino and they all work the same
15. Analog Pins – These pins can read the signal from an analog sensor and convert it to digital

Arduino Power Supply


The Arduino Uno needs a power source in order for it to operate and can be powered in a variety of ways. You
can do what most people do and connect the board directly to your computer via a USB cable. If you want your
project to be mobile, consider using a 9V battery pack to give it juice. The last method would be to use a 9V AC

power supply.
Arduino Breadboard
Another very important item when working with Arduino is a solderless breadboard. This device allows you to
prototype your Arduino project without having to permanently solder the circuit together. Using a breadboard
allows you to create temporary prototypes and experiment with different circuit designs. Inside the holes (tie
points) of the plastic housing, are metal clips which are connected to each other by strips of conductive
material.
On a side note, the breadboard is not powered on its own and needs power brought to it from the Arduino board
using jumper wires. These wires are also used to form the circuit by connecting resistors, switches and other
components together.

Equipment and tool guide


While they’re not necessarily required for the projects in this book, here are some of the more useful pieces of
equipment that you may consider buying when setting up a workspace.
• 30-watt soldering iron and solder.
• Solder sucker to suck up solder.

Session 2
DEVELOPING A C++ PROGRAM
The following three steps are required to create and translate a C++ program:
1. First, a text editor is used to save the C++ program in a text file. In other words, the source code is saved to a
source file. In larger projects the programmer will normally use modular programming. This means that the
source code will be stored in several source files that are edited and translated separately.
2. The source file is put through a compiler for translation. If everything works as planned, an object file made
up of machine code is created. The object file is also referred to as a module
3. Finally, the linker combines the object file with other modules to form an executable file. These further
modules contain functions from standard libraries or parts of the program that have been compiled previously.
It is important to use the correct file extension for the source file’s name. Although the file extension depends
on the compiler you use, the most commonly found file extensions are .cpp and .cc. Prior to compilation, header
files, which are also referred to as include files, can be copied to the source file.
Header files are text files containing information needed by various source files, for example, type definitions
or declarations of variables and functions. Header files can have the file extension .h, but they may not have any
file extension.
The C++ standard library contains predefined and standardized functions that are available for any compiler.
Modern compilers normally offer an integrated software development environment, which combines the steps
mentioned previously into a single task. A graphical user interface is available for editing, compiling, linking,
and running the application. Moreover, additional tools, such as a debugger, can be launched.
A BEGINNER’S C++ PROGRAM
A C++ program is made up of objects with their accompanying member functions and global functions, which
do not belong to any single particular class. Each function fulfills its own particular task and can also call other
functions. You can create functions yourself or use ready-made functions from the standard library. You will
always need to write the global function main () yourself since it has a special role to play; in fact it is the main
program.
The short programming example on the opposite page demonstrates two of the most important elements of a C+
+ program. The program contains only the function main () and displays a message.
The first line begins with the number symbol, #, which indicates that the line is intended for the preprocessor.
The preprocessor is just one step in the first translation phase and no object code is created at this time. You can
type
#include
to have the preprocessor copy the quoted file to this position in the source code. This allows the program access
to all the information contained in the header file. The header file iostream comprises conventions for input and
output streams. The word stream indicates that the information involved will be treated as a flow of data.
Predefined names in C++ are to be found in the std (standard) namespace. The using directive allows direct
access to the names of the std namespace.
Program execution begins with the first instruction in function main(), and this is why each C++ program must
have a main function. The structure of the function is shown on the opposite page. Apart from the fact that the
name cannot be changed, this function’s structure is not different from that of any other C++ function.
In our example the function main () contains two statements. The first statement:

Learning Outcomes
Introduction Session 1: Introduction to Arduino
The teacher will commence the class by asking students, "What is Arduino?" Students will be given the
opportunity to answer. If no one provides an answer, the teacher will randomly select a student to respond.
Following the responses, the teacher will explain the concept of Arduino in their own terms. They will
introduce Arduino as an open-source programmable circuit board that allows users to create interactive
hardware projects. The teacher will then explain how Arduino can sense and control objects in the physical
world, interacting with outputs like LEDs, motors, and displays, setting the foundation for the session.

Session 2: Introduction to C++ Program Development


The teacher will begin the session by asking students, "What are the steps involved in creating a C++
program?" Students will be given the opportunity to answer. If no one provides a response, the teacher will
randomly select a student to respond. Following the answers, the teacher will explain the three essential steps in
C++ program development: writing the source code using a text editor, translating the source file using a
compiler to create an object file, and combining the object file with other modules using a linker to create an
executable file. This will set the foundation for understanding the C++ program development process.
Development / Developmental Session – Introduction to Arduino (Session 1)
Activity /Pedagogy/
Performance  Development:
Criteria The teacher will lead a brief discussion on Arduino, introducing it as an open-source programmable
circuit board used for various interactive projects. Students will explore the key components such as the
microcontroller, input/output pins, and its ability to interact with sensors and outputs like LEDs and
motors. The teacher will emphasize the flexibility and affordability of Arduino for makers and
inventors.
 Activity :
Students will work in pairs and receive an Arduino board. They will be tasked with identifying key
components on the board (microcontroller, pins, power supply, etc.) using a guided worksheet.
Afterward, each pair will briefly explain the function of one component to the class.

Developmental Session – Developing a C++ Program ( Session 2)

 Development:
The teacher will explain the three key steps required to create and translate a C++ program:
1. Writing the source code in a text editor and saving it in a source file (.cpp or .cc).
2. Using a compiler to translate the source file into an object file (machine code).
3. Using a linker to combine the object file with other modules to form an executable program.

The teacher will emphasize the importance of using the correct file extensions and explain the role of
header files in the compilation process. A brief overview of the C++ standard library and its functions
will also be provided.

 Activity:
Students will work individually to create a simple C++ program in a text editor that prints a message to
the console. They will:
1. Write the source code for a basic C++ program using the main() function.
2. Compile the program and check for any errors.
3. Use the linker to combine the program and create an executable file.
Each student will then run their program and display the output.

Closure Session 1
Closure
The teacher will summarize the importance of Arduino in creating interactive projects and encourage students
to think about how they can use Arduino in their own projects. The class will discuss possible future
applications of Arduino in technology.

Session 2
Closure
The teacher will review the steps of writing, compiling, and linking a C++ program and ask students to share
their experience with the activity. The session will conclude with a brief discussion on the importance of
modular programming in larger projects.
Conclusion Session 1: Conclusion – Introduction to Arduino
The teacher will summarize the key points covered, including the definition of Arduino, its components, and its
role in creating interactive hardware projects. Students will be reminded of Arduino's flexibility and
affordability, which make it a popular choice for various projects. The class will reflect on how Arduino can be
applied to different real-world projects, setting the foundation for further exploration in future sessions.

Session 2: Conclusion – Developing a C++ Program


The teacher will review the process of creating a C++ program, from writing the source code, to compiling it,
and finally linking it to create an executable file. The importance of using the correct file extensions and
understanding the role of the main() function will be reinforced. The session will end with a reflection on how
C++ is used to build structured and modular programs, preparing students for more advanced programming
tasks.

Extended Activity Session 1: Extended Activity – Introduction to Arduino


For homework, students will research a simple Arduino project online (e.g., controlling an LED light) and bring
their findings to the next class. They will be asked to explain the project, identify the components used, and
describe how the Arduino board interacts with these components. In the next session, students will share their
findings and discuss potential Arduino projects they might want to create themselves.

Session 2: Extended Activity – Developing a C++ Program


Students will extend their learning by modifying the simple C++ program they created in class. They should
add at least two more functions to their program, each performing a different task (e.g., performing a
calculation or printing a new message). Additionally, students are encouraged to experiment with the use of
header files by creating their own simple header file and including it in their program. In the next session,
students will share the changes they made and discuss how the modifications improved the program’s
functionality.

Evaluation
Strengths
Weakness

You might also like