ARDUINO
By:
Karim ben mohamed
&:
Asmae harayt
&:
Fadma ait ouassa
The teacher :
Mohamed ben zaari
2023 2024
INTRODUCTION :
Programming is writing computer code to create a program, to solve a
problem. Programs are created to implement algorithms. Algorithms can
be represented as pseudocode or a flowchart, and programming is the
translation of these into a computer program.
To tell a computer to do something, a program must be written to tell it
exactly what to do and how to do it. If an algorithm has been designed,
the computer program will follow this algorithm, step-by-step, which will
tell the computer exactly what it should do.
A programming language is an artificial language that a computer
understands. The language is made up of series of statements that fit
together to form instructions. These instructions tell a computer what to
do.
There are many different programming languages, some more complicated
and complex than others. Among the most popular languages are:
JavaScript, used by 65.36%
HTML/CSS, used by 55.08%
SQL, used by 49.43%
Python, used by 48.07%
TypeScript, used by 34.83%
JAVA SCRIPT :
This language is used on every major web browser. JavaScript allows you
to add complex features to a web page, such as content updates,
interactive maps, and animated graphics, develop games, and more.
HTML/CSS :
These languages are used to create web pages and web applications. You
would use HTML (HyperText Markup Language) to build web page
structure, while CSS (Cascading Style Sheets) would enable you to
determine the page’s styling.
SQL:
SQL stands for Structured Query Language and is used to communicate
with databases, including updating and retrieving data.
Python :
Python programming is most used in machine learning, web development,
and desktop applications. Python is a popular language among beginners,
as the syntax is relatively easy to learn. It is known as an object-oriented
programming language.
TypeScript:
TypeScript is a free, open-source programming language developed by
Microsoft as a superset of JavaScript. It’s used for developing large
applications.
Different languages work in different ways. For example, in Python all
instructions are written in lowercase, but in BASIC they tend to be written
in uppercase.
Programming languages are designed to be easy for a human to
understand and write in. However, a computer cannot run programs
written in these languages directly. Most programming languages have to
be translated into machine code before the computer can execute the
instructions.
rogramming refers to a technological process for telling a computer which
tasks to perform in order to solve problems. You can thinPk of programming
as a collaboration between humans and computers, in which humans
create instructions for a computer to follow (code) in a language computers
can understand.
Programming enables so many things in our lives. Here are some
examples:
When you browse a website to find information, contact a service
provider, or make a purchase, programming allows you to interact
with the site’s on-page elements, such as sign-up or purchase
buttons, contact forms, and drop-down menus.
The programming behind a mobile app can make it possible for you to
order food, book a rideshare service, track your fitness, access
media, and more with ease.
Programming helps businesses operate more efficiently through
different software for file storage and automation and video
conferencing tools to connect people globally, among other things.
Space exploration is made possible through programming.
At its most basic, programming tells a computer what to do. First, a
programmer writes code—a set of letters, numbers, and other characters.
Next, a compiler converts each line of code into a language a computer can
understand. Then, the computer scans the code and executes it, thereby
performing a task or series of tasks. Tasks might include displaying an
image on a webpage or changing the font of a section of text.
An important first step is to reflect on your goals and motivations. With
clarity on what you want to achieve and why, you can align your actions
with the outcomes you desire. Here are some examples of programming
goals:
Launch a new programming career in a specific industry.
Explore programming in your current role and take on new projects
that combine programming with what you already do.
Pursue programming as a hobby and complete projects that match
your interests.
As you’re taking courses, you’ll want to ensure you’re developing
essential programming skills, particularly if your goals are to pursue a
new career or enhance your current one. While a course you’re
enrolled in may provide an overview of important programming skills
and then structure the learning experience accordingly, you may find
it helpful to find out what employers are looking for.
According to ZipRecruiter’s Career Keyword Mapper, the
top technical skills employers ask for in programmer job descriptions
include proficiency with languages (JavaScript and SQL), project
management, and computer science [2]. Employers also emphasize
several workplace or “soft” skills like innovation and collaboration.
I. GET STARTED :
1. Arduino :
Arduino is an open-source electronics platform based on easy-to-use
hardware and software. Arduino boards are able to read inputs - light on
a sensor, a finger on a button, or a Twitter message - and turn it into an
output - activating a motor, turning on an LED, publishing something
online. You can tell your board what to do by sending a set of
instructions to the microcontroller on the board. To do so you use
the Arduino programming language (based on Wiring), and the Arduino
Software (IDE), based on Processing.
Over the years Arduino has been the brain of thousands of projects, from
everyday objects to complex scientific instruments. A worldwide
community of makers - students, hobbyists, artists, programmers, and
professionals - has gathered around this open-source platform, their
contributions have added up to an incredible amount of accessible
knowledge that can be of great help to novices and experts alike.
The Arduino project began in 2005 as a tool for students at the Interaction
Design Institute Ivrea, Italy,[3] aiming to provide a low-cost and easy way
for novices and professionals to create devices that interact with their
environment using sensors and actuators. Common examples of such
devices intended for beginner hobbyists include
simple robots, thermostats, and motion detectors.
The Arduino project was started at the Interaction Design Institute
Ivrea (IDII) in Ivrea, Italy.[3] At that time, the students used a BASIC
Stamp microcontroller at a cost of $50. In 2003 Hernando
Barragán created the development platform Wiring as a Master's thesis
project at IDII, under the supervision of Massimo Banzi and Casey Reas.
Casey Reas is known for co-creating, with Ben Fry,
the Processing development platform. The project goal was to create
simple, low cost tools for creating digital projects by non-engineers. The
Wiring platform consisted of a printed circuit board (PCB) with
an ATmega128 microcontroller, an IDE based on Processing and library
functions to easily program the microcontroller. [5] In 2005, Massimo Banzi,
with David Mellis, another IDII student, and David Cuartielles, extended
Wiring by adding support for the cheaper ATmega8 microcontroller. The
new project, forked from Wiring, was called Arduino.[5]
Some pictures :
II. The IDE
Le logiciel Arduino est un Environnement de Développement Intégré (IDE)
open source et gratuit, téléchargeable sur le site officiel Arduino :
www.arduino.cc
L’IDE Arduino permet :
d’éditer un programme : un programme est composé
de croquis (sketch en Anglais),
les programmes sont écrits en langage C
de compiler ce programme dans le langage « machine » de
l’Arduino,
la compilation est une traduction du langage C vers le langage
du microcontrôleur
la zone de sortie donne des informations sur le
déroulement de la compilation et affiche les messages
d’erreur et diverses notifications.
de téléverser le programme dans la mémoire de l’Arduino,
le téléversement (upload) se passe via le port USB de
l’ordinateur
un fois dans la mémoire de l’Arduino, le logiciel s’appelle
un microgiciel.
la zone de sortie donne des informations sur le
déroulement du téléversement et affiche les messages
d’erreur et diverses notifications.
de communiquer avec la carte Arduino grâce
au terminal (ou moniteur série).
pendant le fonctionnement du programme en mémoire sur
l’Arduino, il peut communiquer avec l’ordinateur
tant que la connexion est active (câble USB, …)
III. first project (Blinking LED project ):
how it works:
This example shows the simplest thing you can do with an Arduino to see
physical output: it blinks the on-board LED.
This example uses the built-in LED that most Arduino boards have. This
LED is connected to a digital pin and its number may vary from board
type to board type. To make your life easier, we have a constant that is
specified in every board descriptor file. This constant
is LED_BUILTIN and allows you to control the built-in LED easily. Here is
the correspondence between the constant and the digital pin.
The build :
D13 - 101
D13 - Due
D1 - Gemma
D13 - Intel Edison
D13 - Intel Galileo Gen2
D13 - Leonardo and Micro
D13 - LilyPad
D13 - LilyPad USB
D13 - MEGA2560
D13 - Mini
D6 - MKR1000
D13 - Nano
D13 - Pro
D13 - Pro Mini
D13 - UNO
D13 - Yún
D13 - Zero
The code :
/*
Blink
Turns an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA
and ZERO
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set
to
the correct LED pin independent of which board is used.
If you want to know what pin the on-board LED is connected to on your
Arduino
model, check the Technical Specs of your board at:
https://www.arduino.cc/en/Main/Products
modified 8 May 2014
by Scott Fitzgerald
modified 2 Sep 2016
by Arturo Guadalupi
modified 8 Sep 2016
by Colby Newman
This example code is in the public domain.
https://www.arduino.cc/en/Tutorial/BuiltInExamples/Blink
*/
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage
level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the
voltage LOW
delay(1000); // wait for a second
IV. Project 1 (bleuthoot control car) :
1. How it works :
Bluetooth controlled car is an Arduino based project which controlled
using android application that we have created. In that app we made
some arrow to give movement to the Bluetooth car like forward,
backward, left, right etc. so by this way android app is working as
transmitter and Bluetooth module which is mounted on car is work as
receiver. to transmit the command, we have connected Bluetooth to
that app.
2. The build :
3. Jumper wires (generic)
4. 1
5. Dual H-Bridge motor drivers L298
6. 1
7. Maker Essentials - Micro-motors & Grippy Wheels
8. 1
9. Arduino UNO
10. 1
11. Li-Ion Battery 1000mAh
12. 1
13. LED (generic)
14. 1
15. HC-05 Bluetooth Module
2. The code :
char t;
void setup() {
pinMode(13,OUTPUT); //left motors forward
pinMode(12,OUTPUT); //left motors reverse
pinMode(11,OUTPUT); //right motors forward
pinMode(10,OUTPUT); //right motors reverse
pinMode(9,OUTPUT); //Led
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
t = Serial.read();
Serial.println(t);
if(t == 'F'){ //move forward(all motors rotate in forward direction)
digitalWrite(13,HIGH);
digitalWrite(11,HIGH);
else if(t == 'B'){ //move reverse (all motors rotate in reverse
direction)
digitalWrite(12,HIGH);
digitalWrite(10,HIGH);
else if(t == 'L'){ //turn right (left side motors rotate in forward
direction, right side motors doesn't rotate)
digitalWrite(11,HIGH);
else if(t == 'R'){ //turn left (right side motors rotate in forward
direction, left side motors doesn't rotate)
digitalWrite(13,HIGH);
else if(t == 'W'){ //turn led on or off)
digitalWrite(9,HIGH);
}
else if(t == 'w'){
digitalWrite(9,LOW);
else if(t == 'S'){ //STOP (all motors stop)
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
delay(100);