0% found this document useful (0 votes)
43 views

Arduino Programming Course

The document provides an introduction to programming with Arduino and C language. It discusses [1] learning basic C programming and using it to control electronic devices and circuits, [2] studying programming and electrical components simultaneously, and [3] needing to understand various hardware modules like sensors, LCD displays, and motors. It then covers important C programming concepts like flow control, functions, and algorithms like bubble sort.

Uploaded by

Hoàng Hứa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Arduino Programming Course

The document provides an introduction to programming with Arduino and C language. It discusses [1] learning basic C programming and using it to control electronic devices and circuits, [2] studying programming and electrical components simultaneously, and [3] needing to understand various hardware modules like sensors, LCD displays, and motors. It then covers important C programming concepts like flow control, functions, and algorithms like bubble sort.

Uploaded by

Hoàng Hứa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

programming language for

Arduino
TAGETS OF THIS COURSE

 Can read and write and understand basic C programming


language.

 Can write basic C programming to control


electronic/electrical devices.

 Can understand and communicate with basic circuits,


sensors, actuators.
Studying Programming language and
electrical/electronic components at the same time.
What kind of preson you want to be?

Electronic Mechanical Electrical Lecture


engineer engineer engineer

You will be a/an ……………

Loser officer
Applications Educations, hobby ……
Industrial Applications
RESEACRHING ………..
What kinds of hardwares we need to study ?
• LCD 16x2

•Arduino board

• Real Time module

•Temperature and humidity


module

•Ultrasonic module

•Relay module

•IR module

•DC motor, RC servo


Motor.

RF module.
Language Reference
https://www.arduino.cc/en/Reference/HomePage
C Flow Control 1. C if statement
2. C if … else statement
2. C switch….case statement
2. FOR LOOP
Flowchart of do… while loop

The do..while loop is similar to the while loop with one important difference. The body
ofdo...while loop is executed once, before checking the test expression. Hence,
thedo...while loop is executed at least once.
break Statement
continue Statement
C Programming goto Statement

The use of goto statement may lead to code that is buggy


and hard to follow = try do not use of goto statement
.
C Programming Functions

What is a function in C language ?

A function is a block of code that


performs a specific task.

Why we need to us Functions in


Programming languages ?

Dividing complex problem into small


components makes program easy to
understand and use.
Advantages of user-defined function
• The program will be easier to understand, maintain and debug.
• Reusable codes that can be used in other programs
• A large program can be divided into smaller modules. Hence, a large project
can be divided among many programmers.
Example: User-defined function
Example: Control speed of DC motor.
Arduino – sorting array integers with a bubble sort algorithm

You might also like