Arduino
Arduino
By:
&:
Asmae harayt
&:
The teacher :
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:
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:
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.
Some pictures :
II. The IDE
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
If you want to know what pin the on-board LED is connected to on your
Arduino
https://www.arduino.cc/en/Main/Products
by Scott Fitzgerald
by Arturo Guadalupi
by Colby Newman
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);
void loop() {
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(9,OUTPUT); //Led
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
t = Serial.read();
Serial.println(t);
digitalWrite(13,HIGH);
digitalWrite(11,HIGH);
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);
digitalWrite(9,HIGH);
}
digitalWrite(9,LOW);
digitalWrite(13,LOW);
digitalWrite(12,LOW);
digitalWrite(11,LOW);
digitalWrite(10,LOW);
delay(100);