Learn Arduino Sensors Complete Hand Guide Beginner To Core - Sathish, Janani - 2021 - Anna's Archive
Learn Arduino Sensors Complete Hand Guide Beginner To Core - Sathish, Janani - 2021 - Anna's Archive
BY
JANANI SATHISH
CONTENTS
WHAT IS ARDUINO
THE HOLE ON BOARD
WHAT IS A MICROCONTROLLER
WHAT IS ARDUINO RASPBERRY PI AND PIC
MICROCONTROLLER
KY-001 TEMPERATURE SENSOR MODULE
KY-002 VIBRATION SWITCH MODULE
KY-003 HALL MAGNETIC SENSOR MODULE
KY-004 KEY SWITCH MODULE
KY-005 INFRARED EMISSION SENSOR MODULE
KY-006 SMALL PASSIVE BUZZER MODULE
KY-008 LASER SENSOR MODULE
KY-009 3-COLOUR FULL-COLOUR LED SMD MODULES
KY- 010 OPTICAL BROKEN MODULE
KY-011 2-COLOUR LED MODULE
KY-012 ACTIVE BUZZER MODULE
KY-013 TEMPERATURE SENSOR MODULE
KY-015 TEMPERATURE AND HUMIDITY SENSOR MODULE
KY-016 3-COLOUR LED MODULE
KY-017 MERCURY OPEN OPTICAL MODULE
KY-018 PHOTO RESISTOR MODULE
KY-019 5V RELAY MODULE
KY-020 TILT SWITCH MODULE
KY-021 MINI MAGNETIC REED MODULES
KY-022 INFRARED SENSOR RECEIVER MODULE
KY-023 XY-AXIS JOYSTICK MODULE
KY-024 LINEAR MAGNETIC HALL SENSORS
KY-025 REED MODULE
KY-026 FLAME SENSOR MODULE
KY-027 MAGIC LIGHT CUP MODULE
KY-028 TEMPERATURE SENSOR MODULE
KY-029 YIN YI 2-COLOUR LED MODULE 3MM
KY-031 KNOCK SENSOR MODULE
KY-032 OBSTACLE AVOIDANCE SENSOR MODULE
KY-033 HUNT SENSOR MODULE
KY-0347 COLOUR LED FLASH-MODULE
KY-035 BIHOR MAGNETIC SENSOR MODULE
KY-036 METAL-TOUCH SENSOR MODULE
KY-037 MICROPHONE SENSOR MODULE
KY-038 MICROPHONE SOUND SENSOR MODULE
KY-039 HEARTBEAT SENSOR MODULE
KY-040 ROTARY ENCODER
RASPBERRY PI CONNECTIONS
RASPBERRY PI CONFIGURATION AND CODE
ARDUINO AND RASPBERRY PI CONNNECTION
HOW ARDUINO THINKS
ARDUINO SYNTAX WITH EXAMPLE
ASSEMBLING A CIRCUIT
ARDUINO SOFTWARE FOR THE FIRST TIMERS
ARDUINO SYNTAX
FINISHING CONFIGURATION
THE BREADBOARD
IF A CONDITIONAL STATEMENT
FOR LOOP
WHILE LOOP
USE AN ARRAYS
CONTRAST BETWEEN INPUT AND OUTPUT
LED MULTIPLE
BUTTON INPUT AND LED
INPUTS BUTTONS
IR SENSOR INPUT ANALOG
POTENTIOMETER INPUT ANALOG
ANALOGUE INPUT WITH EXAMPLE
LIQUID CRYSTAL DISPLAY
QUICK SUMMARY OF THE MAIN DIFFERENCES
HARDWARE POWER AND
CONNECTIVITY
COMPARISON OF SOFTWARE
EXPAND THE NEXT CAPABLITIES
BASIC PARTS REQUIREMENTS
THE PART NEEDED TO COMPLETE THE WORK
POWER SUPPLY WIRE
ARDUINO IS READY
YOUR BOOTLOADING CHIPS OPTIONAL
COMPLETE AND BURN BOOTLOADER
ATMEL ATMEGA 328 DETAILS
DIGITAL AND SERIAL PORT
MOTORS TYPES
SIMPLE DC MOTOR
SERVO MOTOR
STEPPER MOTOR
RUNNING A DC MOTOR
RUNNING A SERVO MOTOR
ARDUINO BLUETOOTH
INTRODUCTION AND HISTORY OF WIRELESS POWER
HOW WIRELESS POWER WORKS
ADVANTAGES AND DISADVANTAGES
SCOPE OF WITRICITY AND WITRICITY APPLICATIONS
HOW DOES IT WORK
ANDROID APPLICATION
SCHEMATIC
CODE
TESTING CODE
EARN WITH ARDUINO
WHAT IS ARDUINO
You will get my thoughts regarding Arduino nuts and bolts.
Furthermore, in the second the case of how programming should be
possible with Arduino. Before we go further, I need to help you to
remember a portion of the things that Arduino is famous with today, it
is utilized in four distinctive IoT executions all through the world.
Arduino gadgets are modest, they decrease utilization and which is
the reason they are extremely well known for use in the web usage
of things. In the primary module, we have seen various things, we
have perceived the idea of the Internet of Things, the fundamental
idea, the general component of the piloti merchandise. We have
seen that there are different sorts of sensors, different kinds of
sensors that might be different sorts of actuators, the standards
behind different kinds of feeling different kinds of activation. We have
seen that there are different sorts of organizations that are feasible
for us. Creation for use in IoT different kinds of specialized gadgets
can be utilized to convey in the web things. Getting it, how might we
utilize these ideas to fabricate genuine web in savvy home situations
at home to improve me from them, you know, the everyday errands
we do at home or a keen home, brilliant city situation, as In shrewd
medical clinics, keen urban communities, you know, keen
transportation, vehicles associated, we need to take it diverse IoT
gadget help. What's more, one of the mainstream is Arduino. We
know whether we need to utilize the development of the web. You
need to purchase this which is very modest.
And afterwards, you need to program this, and this is the thing that I
will show you in this specific course. With me, I have Mr The not
fixed Mukherjee will dominate and Mukherjee will take you through
your hands - Arduino programming to from the start of the rudiments
for it will be very modern the idea of Arduino programming. I need to
show you first how the Arduino gadget looks. This is Arduino Uno.
Arduino Uno, Arduino has an alternate variation, they all have the
distinctions you know, contrasts in Andon determinations. This is
Arduino Uno. Furthermore, this gadget should be modified. It should
be customized, as you can see here, the size is little and can be
extremely incorporated with this web. You know, when you attempt to
apply the Internet of Things. It very well may be actualized
previously. This gadget is really, you know the diverse SERR that
you know learning in this specific course. This diverse SENR can be
introduced on this gadget, various actuators can be introduced on
this gadget and SENRS, distinctive SENRs and different actuators
after introducing information got from a similar depiction. It tends to
be shipped off the correspondence unit for this situation that will be
examined by the Rupee and how this information can be scattered
and can be sent for additional investigation for Andon stockpiling. I
will take you through Arduino's fundamental highlights in this talk.
First and foremost, as you have heard, Arduino has become
extremely famous today. Most importantly, the fundamental Rean,
this is an open programmable program board
WHAT IS A MICROCONTROLLER
Miniature supernatural occurrence about the microcontroller. Above
all else, we need to comprehend the contrast between
microcontrollers and microchips. Well if we say the microchip as a
PC cerebrum, you can say that the microcontroller capacities as the
mind and muscles for PCs. As such, the microcontroller is a
framework on the chip. This implies that the chip has four kilobytes
of smash. It has a hard circle, there are 32 kilobytes, and the
processor comprises eight megahertz. Indeed, this framework and
detail sound extremely low, yet they can run practically all projects
required in numerous thighs simply little memory thighs. Great about
microcontrollers in their design. In three to eight, we have 28 pins.
You can see here, thighs are the actual number of pins and in pink,
you can see that the number allocated in Harding, you can see that
the pin four, four on an actual pin is a two pin in Arduino. On the
whole parts, we will manage Arduino Pin in Arduino. OK, presently
you can see here that the eight microcontrollers, what will be 10 will
be set as a memory design or engineering Z there are different sorts
of microcontrollers who have somewhat 16-cycle engineering and
64-digit, yet here we will work with eight-Bit.
many.
We will see this third quick regulator. So how about we start with Arduino. What is
a workmanship we know and we know is a bunch of improvement sheets that
accompanied equipment libraries and imaginative programming? This implies you
can purchase Arduino sheets and begin building up your undertaking and moment
sheets worked around the AVR microcontroller are ribose fundamental
programming on the board and accessible with the expectation of complimentary
coding for Arduino programming for administrator investigates my control. The
lone contrast is that the program for Arduino was written in its language called
Arduino programming language. This language is equivalent to any C
programming language except that everything is prepared to utilize the program to
peruse and compose and. A little memory has been composed by somebody. We
just need to call some unacceptable capacities to attempt to add the location and
incentive as you find in this line. Sambo if you need to blend with you is a
sequential bar. You don't have to introduce it on a register or board, simply call the
sequential. At that point attempt word hi so you can print it in the sequential port.
This is an illustration of Arduino's board. It's omega monstrous as should be
obvious. It has the best processor. So how about we proceed. What is my
extraordinary control that is typically spoken as a photograph is a microcontroller
family made by CPU innovation that comes from 16 50 beginning on the floor by
instrument model Microelectronics Division Model VIC has memory or space or
field of perusing or even on the program stockpiling? Some with a wide vision for
eliminating memory.
All models presently utilize streak memory for the program. Also, a more up to
date manual permits it to get back to the actual program. Program memory and
isolated. One is 8 pieces of 16 pieces and many. It is wide 32-digit program
guidelines and pieces tally a great deal of back Pfeiffer and perhaps 1214 16 or 24
pieces. The guidance set additionally differs by a model with a more grounded chip
that adds directions for the Digital PIN 0 144 sign preparing capacity that has
discrete Input-yield Benn ADC and DSC which means transforming it into different
changes and your great correspondence. I see jars and even you become
honorable varieties and fast there for some sorts. Producers of PC programming
for the advancement known as rout. This isn't the most celebrated and most
renowned called Crecy and accessible free of charge online constructing agents
and compiler C ++. Outsiders and a few open-source gadgets are additionally
accessible. This is how Mac Big. I see Loke. It doesn't rise like here. If we talk
about Arduino Scott like Arduino board it's simply I see as you can see it's simply
decent and you need to associate it somewhere around understanding what
garbage bin be associated or with a stockpile of wire. We will talk about this in the
forthcoming exercises. Presently we should discuss the past r aspberry as you see
this is the soul of the card-sized PC initially intended for instruction enlivened by
the nineteenth 81 BBC Micro Creator Ibn Uptown.
The point is to make minimal effort gadgets that will improve programming abilities
and help with college level arrangement. In any case, on account of its little size
and the value that can be gotten to immediately embraced by tinkles making
vehicles and electronic fans for projects that need more than essential math, for
example, Arduino or the distant regulator that I accept is more slow than present
day PCs or work areas yet completely Linux and can Providing all normal
capacities that suggest at low degrees of utilization. So this is a quick presentation.
It is a quick prologue to Big Mike. Regardless of whether we are not raspberry pi.
On the off chance that you don't have the foggiest idea about this. Regulator or
minicomputer. Then, we will speak more about the contrast between the three.
However, we need to discuss what every one of them so on the off chance that
you just come out somewhat about or to my control, you will understand what
resembles what the particulars are. So it's for this exercise. Much obliged to you
for watching. This is instructive training designing group.
In
different words to keep the current from consuming our module that
LED illuminates to show is the module is working appropriately or
not. Presently, I will show how these parts are associated together.
There we have the actual sensor and obviously, the LED light and
there it is you Sir r1 on the third tube To perceive how the pins of the
modules are associated with this board. Thus, we have web the
progression of the voltage in dark with the progression of ground.
What's more, in green the progression of the indication of this
module it is yours to quantify the temperature with a sensor like
Dallas d s 18 b 20, which has a temperature range from less than 55
entryways Celsius to in addition to 125 check Celsius or less 67
evaluations Fahrenheit to 257.
CONNECTIONS ARDUINO:
Sensor Signal = [Pin 4]
Sensor +V = [Pin 5V]
Sensor - = [Pin GND]
INPUT:
EXAMPLE SENSOR CODE:
#include <OneWire.h>
#include <DallasTemperature.h>
void setup(void)
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin(); // IC Default 9 bit. If you have troubles consider
upping it 12. Ups the delay giving the IC more time to process the
temperature measurement
}
void loop(void)
{
// call sensors.requestTemperatures() to issue a global temperature
// request to all devices on the bus
Serial.print("Requesting temperatures...");
sensors.requestTemperatures(); // Send the command to get
temperatures
Serial.println("DONE");
have the ground torment with the less significant, the voltage pin in
the centre, and obviously, the agony of the sign with an S sign. So
we should discuss the indication of this module gives an advanced
sign. So we can interface the pins of the endorser with any advanced
port or the distinctive microcontrollers, like Arduino or Raspberry Pi.
Connections Arduino:
LED + = [Pin 13]
LED - = [Pin GND]
Sensor Signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor - = [PinGND]
INPUT:
EXAMPLE SENSOR CODE:
void setup () {
pinMode (Led, OUTPUT); // LED pin as output
pinMode (shock, INPUT); // input from KY-002 sensor
}
void loop () {
val = digitalRead (shock); // read the value from KY-002
if (val == HIGH ) {// when sensor detects shock, LED
flashes
digitalWrite(Led, LOW);
} else {
digitalWrite (Led, HIGH);
CONNECTIONS ARDUINO:
LED + = [Pin 13]
LED - = [Pin GND]
Sensor Signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor - = [Pin GND]
INPUT:
EXAMPLE SENSOR CODE:
int led = 13; //Define the LED pin
intbuttonpin = 3; //Define the push button pin
intval; //Define a numeric variable
void setup()
{
pinMode(led,OUTPUT);
pinMode(buttonpin,INPUT);
}
void loop()
{
val = digitalRead(buttonpin); // check the state of the button
if(val==HIGH) // if button is pressed, turn LED on
{
digitalWrite(led,HIGH);
}
else
{
digitalWrite(led,LOW);
INPUT:
EXAMPLE SENSOR CODE:
int led = 13; //Define the LED pin
intbuttonpin = 3; //Define the push button pin
intval; //Define a numeric variable
void setup()
{
pinMode(led,OUTPUT);
pinMode(buttonpin,INPUT);
}
void loop()
{
val = digitalRead(buttonpin); // check the state of the button
if(val==HIGH) // if button is pressed, turn LED on
{
digitalWrite(led,HIGH);
}
else
{
digitalWrite(led,LOW)
INPUT:
void loop()
{
for (inti = 0; i< 50; i++) {
irsend.sendSony(0xa90, 12); // Sony TV power code
delay(40);
CONNECTIONS ARDUINO:
Sensor signal = [Pin 8]
Sensor - = [Pin GND]
INPUT:
void setup() {
pinMode(buzzer, OUTPUT); // set pin 8 as output
}
void loop() {
for (inti = 0; i< 80; i++) { // make a sound
digitalWrite(buzzer, HIGH); // send high signal to buzzer
delay(1); // delay 1ms
digitalWrite(buzzer, LOW); // send low signal to buzzer
delay(1);
}
delay(50);
for (int j = 0; j < 100; j++) { //make another sound
digitalWrite(buzzer, HIGH);
delay(2); // delay 2ms
digitalWrite(buzzer, LOW);
delay(2);
}
delay(100);
The pins in this module are three. We have the ground pin with the
short sign, the voltage pin is in the centre. Also, obviously, we have a
circling of the sign with an S sign. So we should discuss the sign.
This module takes an advanced sign. So we can interface the pin of
the sign with any advanced port of various microcontroller sheets like
Arduino or Raspberry Pi.
EXAMPLE SENSOR CODE:
intlaserPin = 13;
void setup() {
pinMode(laserPin, OUTPUT); // Define the digital output
interface pin 13
}
void loop() {
digitalWrite(laserPin, HIGH); // Open the laser head
delay(1000); // Delay one second
digitalWrite(laserPin, LOW); // Close the laser head
delay(1000);
INPUT:
intval;
void setup() {
pinMode(redpin, OUTPUT);
pinMode(bluepin, OUTPUT);
pinMode(greenpin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
for(val = 255; val> 0; val--)
{
analogueWrite(redpin, val); //set PWM value for red
analogueWrite(bluepin, 255 - val); //set PWM value for blue
analogueWrite(greenpin, 128 - val); //set PWM value for green
Serial.println(val); //print current value
delay(1);
}
for(val = 0; val< 255; val++)
{
analogueWrite(redpin, val);
analogueWrite(bluepin, 255 - val);
analogueWrite(greenpin, 128 - val);
Serial.println(val);
delay(1);
this module is three. So we have the ground pin with a less sign. The
voltage pin in the centre and obviously, the pin of the sign With an S
sign. So we should discuss the sign. This module gives an advanced
sign. So we can interface the pins of the sign with any computerized
ports of various microcontroller sheets like Arduino or Raspberry Pi.
CONNECTIONS ARDUINO:
LED + = [Pin 13]
LED - = [Pin GND]
Sensor Signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor - = [Pin GND]
INPUT:
EXAMPLE SENSOR CODE:
int Led = 13; // define LED pin
intbuttonpin = 3; // define photo interrupter signal pin
intval; //define a numeric variable
void setup()
{
pinMode(Led, OUTPUT); // LED pin as output
pinMode(buttonpin, INPUT); //photo interrupter pin as input
}
void loop()
{
val=digitalRead(buttonpin); //read the value of the sensor
if(val == HIGH) // turn on LED when sensor is blocked
{
digitalWrite(Led,HIGH);
}
else
{
digitalWrite(Led,LOW);
CONNECTIONS ARDUINO:
LED Green = [Pin 10]
LED Red = [Pin 11]
Sensor GND = [Pin GND]
INPUT:
EXAMPLE SENSOR CODE:
intredpin = 11; // pin for red signal
intgreenpin = 10; // pin for green signal
intval;
void setup() {
pinMode(redpin, OUTPUT);
pinMode(greenpin, OUTPUT);
}
void loop() {
for(val = 255; val> 0; val--) {
analogueWrite(redpin, val); //dim red
analogueWrite(greenpin, 255 - val); // brighten green
delay(15);
}
for(val = 0; val< 255; val++) {
analogueWrite(redpin, val); //brighten red
analogueWrite(greenpin, 255 - val); //dim green
delay(15);
sign.
So we should discuss the sign. This module gives a simple sign So
we can interface the agony of the sign with any simple port of
various microcontroller sheets like Arduino or Raspberry Pi.
CONNECTIONS ARDUINO:
Sensor Signal = [Pin 13]
Sensor [N.C] =
Sensor GND = [Pin GND]
void setup() {
Serial.begin(9600);
}
void loop() {
Vo = analogueRead(ThermistorPin);
R2 = R1 * (1023.0 / (float)Vo - 1.0); //calculate resistance on
thermistor
logR2 = log(R2);
T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2)); // temperature
in Kelvin
T = T - 273.15; //convert Kelvin to Celcius
// T = (T * 9.0)/ 5.0 + 32.0; //convert Celcius to Farenheit
Serial.print("Temperature: ");
Serial.print(T);
Serial.println(" C");
delay(500);
}
INPUT:
CONNECTIONS ARDUINO:
GND = [Pin GND]
+V = [Pin 5V]
Signal = [Pin D2]
EXAMPLE SENSOR CODE:
intDHpin = 8; // input/output pin
bytedat[5];
byteread_data()
{
bytei = 0;
byte result = 0;
for (i = 0; i< 8; i++) {
while (digitalRead(DHpin) == LOW); // wait 50us
delayMicroseconds(30); //The duration of the high level is judged to
determine whether the data is '0' or '1'
if (digitalRead(DHpin) == HIGH)
result |= (1 << (8 - i)); //High in the former, low in the post
while (digitalRead(DHpin) == HIGH); //Data '1', waiting for the next
bit of reception
}
return result;
}
voidstart_test()
{
digitalWrite(DHpin, LOW); //Pull down the bus to send the start
signal
delay(30); //The delay is greater than 18 ms so that DHT 11 can
detect the start signal
digitalWrite(DHpin, HIGH);
delayMicroseconds(40); //Wait for DHT11 to respond
pinMode(DHpin, INPUT);
while(digitalRead(DHpin) == HIGH);
delayMicroseconds(80); //The DHT11 responds by pulling the bus
low for 80us;
if(digitalRead(DHpin) == LOW)
delayMicroseconds(80); //DHT11 pulled up after the bus 80us to start
sending data;
for(inti = 0; i< 5; i++) //Receiving temperature and humidity data,
check bits are not considered;
dat[i] = read_data();
pinMode(DHpin, OUTPUT);
digitalWrite(DHpin, HIGH); //After the completion of a release of data
bus, waiting for the host to start the next signal
}
void setup()
{
Serial.begin(9600);
pinMode(DHpin, OUTPUT);
}
void loop()
{
start_test();
Serial.print("Humdity = ");
Serial.print(dat[0], DEC); //Displays the integer bits of humidity;
Serial.print('.');
Serial.print(dat[1], DEC); //Displays the decimal places of the
humidity;
Serial.println('%');
Serial.print("Temperature = ");
Serial.print(dat[2], DEC); //Displays the integer bits of temperature;
Serial.print('.');
Serial.print(dat[3], DEC); //Displays the decimal places of the
temperature;
Serial.println('C');
byte checksum = dat[0] + dat[1] + dat[2] + dat[3];
if (dat[4] != checksum)
Serial.println("-- Checksum Error!");
else
Serial.println("-- OK");
delay(1000);
CONNECTIONS ARDUINO:
LED Red = [Pin 10]
LED Green = [Pin 11]
LED Blue = [Pin 12]
Sensor GND = [Pin GND]
Serial.println(val, DEC);
delay(5);
CONNECTIONS ARDUINO:
LED + = [Pin 13]
LED - = [Pin GND]
Sensor Signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor - = [Pin GND]
INPUT:
void setup() {
Serial.begin(9600);
}
void loop() {
value = analogueRead(sensorPin);
Serial.println(value, DEC); // light intensity
// high values for bright environment
// low values for dark environment
delay(100);
Pi.
CONNECTIONS ARDUINO:
LED + = [Pin 13]
LED - = [Pin GND]
Sensor Signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor - = [Pin GND]
INPUT:
void setup() {
//pinMode(A0, INPUT);
//pinMode(A1, INPUT);
pinMode(7, INPUT_PULLUP); //set pin 7 as an input and
enable the internal pull-up resistor
Serial.begin(9600);
}
void loop() {
value = analogueRead(A0); // read X axis value [0..1023]
Serial.print("X:");
Serial.print(value, DEC);
value = analogueRead(A1); // read Y axis value [0..1023]
Serial.print(" | Y:");
Serial.print(value, DEC);
value = digitalRead(7); // read Button state [0,1]
Serial.print(" | Button:");
Serial.println(value, DEC);
delay(100);
INPUT:
EXAMPLE SENSOR CODE:
int led = 13 ; // LED on arduino
intdigitalPin = 3; // linear Hall magnetic sensor digital interface
intanaloguePin = A0; // linear Hall magnetic sensor analogue
interface
intdigitalVal ; // digital readings
intanalogueVal; // analogue readings
void setup ()
{
pinMode (led, OUTPUT);
pinMode (digitalPin, INPUT);
//pinMode(analoguePin, INPUT);
Serial.begin(9600);
}
void loop ()
{
// Read the digital interface
digitalVal = digitalRead(digitalPin) ;
if (digitalVal == HIGH) // When magnetic field is present, Arduino
LED is on
{
digitalWrite (led, HIGH);
}
else
{
digitalWrite (led, LOW);
}
// Read the analogue interface
analogueVal = analogueRead(analoguePin);
Serial.println(analogueVal); // print analogue value
delay(100);
INPUT:
void loop()
{
// Read the digital interface
digitalVal = digitalRead(digitalPin);
if(digitalVal == HIGH) // if magnetic field is detected
{
digitalWrite(led, HIGH); // turn ON Arduino's LED
}
else
{
digitalWrite(led, LOW); // turn OFF Arduino's LED
}
delay(100);
KY-026 FLAME SENSOR MODULE
CONNECTIONS ARDUINO:
digital signal = [Pin 3]
+V = [Pin 5V]
GND = [Pin GND]
analogue signal = [Pin 0]
INPUT:
void setup()
{
pinMode(led, OUTPUT);
pinMode(digitalPin, INPUT);
//pinMode(analoguePin, OUTPUT);
Serial.begin(9600);
}
void loop()
{
// Read the digital interface
digitalVal = digitalRead(digitalPin);
if(digitalVal == HIGH) // if flame is detected
{
digitalWrite(led, HIGH); // turn ON Arduino's LED
}
else
{
digitalWrite(led, LOW); // turn OFF Arduino's LED
}
delay(100);
the sign will change excessively low. On other hand, the LED of the
module we can turn on
or then again off as we wish, because the LED takes a sign that
comes straightforwardly from any microcontroller. We should discuss
the pins. The pins in this module are four. We have the ground pin
with a G sign, the voltage pin with an or more sign. The mercury
switch signal has the S sign and the Led signal has the L sign. So
we should discuss the sign. This module gives one computerized
sign and takes one advanced sign. So we can associate the pins of
the signs with any advanced port of various microcontroller sheets
like Arduino or Raspberry Pi.
CONNECTIONS ARDUINO:
LED + = [Pin 13]
LED - = [Pin GND]
Sensor signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor - = [Pin GND]
INPUT:
EXAMPLE SENSOR CODE:
intledPinA = 9;
intswitchPinA = 8;
intswitchStateA = 0;
intledPinB = 6;
intswitchPinB = 7;
intswitchStateB = 0;
int brightness = 0;
void setup()
{
pinMode(ledPinA, OUTPUT);
pinMode(ledPinB, OUTPUT);
pinMode(switchPinA, INPUT);
pinMode(switchPinB, INPUT);
}
void loop()
{
switchStateA = digitalRead(switchPinA);
if (switchStateA == HIGH && brightness != 255)
{
brightness ++;
}
switchStateB = digitalRead(switchPinB);
if (switchStateB == HIGH && brightness != 0)
{
brightness --;
}
analogueWrite(ledPinA, brightness); // A slow fade out
analogueWrite(ledPinB, 255 - brightness); // B slow bright up
delay(20);
CONNECTIONS ARDUINO:
digital signal = [Pin 3]
+V = [Pin 5V]
GND = [Pin GND]
analogue Signal = [Pin 0]
INPUT:
EXAMPLE SENSOR CODE:
delay(100);
INPUT:
The deterrent shirking sensor is known as KY0 32. This is simply the
module. So we should begin. This module is incorporated on board
two sensors, one infrared transmitter and one infrared collector.
additionally incorporated onboard one microprocessor, one
potentiometer, five resistors, two capacitors and two LVDS. The
resistor r1 utilized in this module is a one-kilo ohm resistor R two is
the one-kilo ohm. There is this there are three it's 100 ohms. There
is this there are four it's Thank you ohms and there is these there are
five it's 10-kilo ohms. The principle purpose behind utilizing the
resistor is to restrict cash ordering inside the module. At the end of
the day, to keep current from consuming our module. We likewise
have two capacitors, the capacitor swan with a limit of 0.2 on
miniature farad and capacitor C two with a limit of 0.1 miniature farad
which is fundamentally used to store energy verla dl one is utilizing
module to show is the module is working appropriately or not. Also,
the LED to show if the module has distinguished any obstruction. So
the LED will illuminate each time that any deterrent has been
identified by the sensors. Presently I will show
how these parts are associated together. There we have the actual
sensors, and, five resistors, two capacitors and two LEDs. On the
correct, you can perceive how the piece of the module symbol nated.
On this board, we have in dark, the progression of the ground, we
have delta the progression of the voltage and obviously, we have in
green, the progression of the sign. This module's used to identify the
obstructions that are before the module. The greatest distance that
the sensor can identify it's up to 40 centimetres. The sensor says Or
communicates a 38 kilohertz infrared light that can go up to 40
centimetres. Furthermore, we can change it by utilizing the
potentiometer. After transmission, the infrared light will disperse in
the air. In any case, on the off chance that they hit something that is
between 0centimeters to the greatest distance that we need, a
portion of the red light will be consumed by the actual item and the
rest will be back, which at that point will be caught by the Empire the
beneficiary. In an ordinary state when the infrared recipient has not
caught any infrared light discharged by the transmitter, the sign that
the collector will give it will be high, yet in the wake of recognizing
the infrared light, the infrared beneficiary will give a sign that will
below and in a similar time, the LED l will illuminate showing us that
is an article before the sun. The module is excellent at identifying the
deterrent. What's more, the sign that reveals to us that the item has
been distinguished comes immediately. We should discuss the pins.
The pins in this module are three, we have the ground pin with a
GND sign, the voltage pin with a Vcc sign, and the pin of the sign
with an outside.lets talk about the sign. This module gives a
computerized signal. So we can interface the pins of the sign with
any advanced ports of various microcontroller sheets likeArduino or
Raspberry Pi.
CONNECTIONS ARDUINO:
Sensor enable = [N.C. (jumper plugged in)]
Sensor signal = [Pin 10]
Sensor +V = [Pin 5V]
Sensor GND = [Pin GND]
We should discuss the piece. The piece in this module are three, we
have the ground pin with a GND sign, the voltage pin with a Vcc
sign, and the pin of the sign with an outside. So we should discuss
the sign. This module gives an advanced sign. So we can interface
the pins of the sign with any advanced ports of various
microcontroller sheets like Arduino or Raspberry Pi.
INPUT:
EXAMPLE SENSOR CODE:
int Sensor = 3; // sensor input pin
void setup ()
{
Serial.begin(9600); // Initialize serial output
pinMode (Sensor, INPUT) ;
}
void loop ()
{
boolval = digitalRead (Sensor) ; // The current signal of the sensor
will be read
if (val == HIGH)
{
Serial.println("Line detected");
Presently, I will show how these parts are associated together. There
we have the programmed shading LED, and obviously, there is
Easter r1. On the correct, you can perceive how the piece of the
module symbol nated. On this board, we have in dark, the
progression of the ground, we have web the progression of the
voltage and obviously, we have in green, the progression of the sign.
Outwardly D can create light in seven distinct tones and can change
starting with one shading then onto the next naturally. This module is
modified since Creation, and we can't change the time, the cycles or
the request that the tones have appeared. There's nothing left but to
associate the module with any microcontroller board and utilize the
board like a change to kill the LED on or. We should discuss the
pins. The pins in this module are three, we have the ground pin with
the short sign, the voltage pin is in the centre. Furthermore, we have
the pin of the sign with the S sign. So we should discuss the sign.
This module takes an advanced sign, so we can associate the pin of
the sign with any computerized part of various microcontroller sheets
like Arduino or Raspberry Pi
CONNECTIONS ARDUINO:
Sensor Signal = [Pin 13]
Sensor [N.C] =
Sensor GND = [Pin GND]
INPUT:
We should discuss the pins. The pins in this module are three, we
have the ground pin with a short sign, the voltage pin is in the centre.
Also, we have the pin of the sign with the S sign. So we should
discuss the sign. This module gives a simple sign so we can
associate the pin of the sign with any simple port of various
microcontroller sheets like Arduino You know or Raspberry Pi.
INPUT:
In ordinary express, the computerized yield that This module will give
will be high. However, when the sensor distinguishes something, the
computerized yield that the module will give will below. Let's a
discussion about the pins. The pins in this module are four. We have
the ground pin with the G sign. We have the voltage pin with the in
addition to sign. We have the simple pin with a 0 sine and obviously,
we have the computerized pin with the 0sign. So we should discuss
the sign. This module gives two signs, we can interface the pin of the
simple sign with any simple port, and the pin of the computerized
signal with any advanced port of various microcontroller sheets like
Arduino or Raspberry Pi.
CONNECTIONS ARDUINO:
digital signal = [Pin 3]
+V = [Pin 5V]
GND = [Pin GND]
analogue signal = [Pin 0]
INPUT:
void setup ()
{
pinMode (Analogue_Eingang, INPUT);
pinMode (Digital_Eingang, INPUT);
if(Digital==1)
{
Serial.println (" reached");
}
else
{
Serial.println (" not reached yet");
}
Serial.println ("----------------------------------------------------------------");
delay (200);
}
KY-038 MICROPHONE SOUND
SENSOR MODULE
CONNECTIONS ARDUINO:
CLK = [Pin 3]
DT = [Pin 4]
Button = [Pin 5]
+ = [Pin 5V]
GND = [Pin GND]
INPUT:
void setup()
{
// Initialization of the input-pins...
pinMode (pin_clk,INPUT);
pinMode (pin_dt,INPUT);
pinMode (button_pin,INPUT);
// The program checks, which of the status pins have changed first,
to calculate the rotational direction,<br />// after a change of the pin
status was detected.
// You will get this information if you compare the pin status of the
current run with the pin status of the run before.<br />// After
detecting the rotational direction, the steps from the start position will
be counted and outputted.<br />// Pushing the button of the rotary
encoder will reset the current position.
void loop()
{
// Reading of the current status
Pin_clk_Aktuell = digitalRead(pin_clk);
if (digitalRead(pin_dt) != Pin_clk_Aktuell)
{
// Pin_CLK has changed first
Counter ++;
Richtung = true;
}
else
{ // ElsePin_DT changed first
Richtung = false;
Counter--;
}
Serial.println ("Rotation detected: ");
Serial.print ("Rotational direction: ");
if (Richtung)
{
Serial.println ("Clockwise");
}
else
{
Serial.println("Counterclockwise");
}
}
RASPBERRY PI CONNECTIONS
This is
a cable we will use to connect Arduino to the raspberry body. So let's start. For a
connection box to connect the advantage to number 11 as shown in the image
below. This board cuts the bread. This is raspberry by. And this leads. We will
connect this causing to be number 11 in the Army in a ball. Other treadmills will be
well connected to the ground.
So let's start using fluty sized software to make this simple circuit. Now here we
have software to visit circuit simulations and circuit designs. This is called Zing
flight. Free. You can get it and download it go to Ceviche. I believe Billyboy. And
you will find that we are proven by buying. Come on, go with a hospital by B. All
worries will trust Billyboy. You can't choose all this. As you can see this in the body
of the hospital is. Now we need a good one. This is good. It's Eilidh. We also need
a large board ok. Now we have our board, we need all this to cause this ball. But
before going further, we need to review this connection. As you can see, this round
must be connected to the Arduino board land. Another trash can which should be
connected to number 11 OK. Now if it's here, you will find that this is our number,
this is number 9 8 11. This is the number 11 G-B or 11 as you can see. So we went
here and we can connect it with this ok. There he is. We make the last bit about
connections as you can see here. We have connected the land. There have been
a number of those last about this advantage. This lead will blink when receiving
the sentence from what we know.
RASPBERRY PI CONFIGURATION
AND CODE
Let's start turning and go with the right spirit with and three orbin in a new window
if you want. But talking about Trust Baranbar you can check our course or satisfy
according to step-by-step steps to learn how to play it by using it and how to write
your Won code in it. You don't need to write the following code in a new window
and save it on your desktop is a good place so you don't lose it. This is the code.
Let's start by explaining this very simple raspberry with the code so you will know
what you write. First, we import serial communication and time libraries. We also
import the input-output library that can be borne by RB which for us with the input
and output barbusinput. This is what stands for this. This is to import. Next, we
define serial communication so that it is the same as serial. This is the location for
serial communication devices in this case Arduino. We will change this and that
the fuel comes but for now, you need to understand this line and this is a change in
badly 9600. This is i. M. But that is here as found from us. Dev D D D Y If we are
this command, we will see a list of serial communication devices after connecting
Beary we all find something like this with the iron bar afterwards. We need to
change that number with the new bar after the connection. We will discuss this
again in some of the upcoming lessons. C from squares is 9600. It is to sit around
the level of serial communication between Arduino and the next raspberry we have
a difference. It's for Blinking LED now John scattered and will choose out. But for
Ben which is only a little high input-output so that it will send 5 volts or 1 logic for
this so it can flash then it will wait one second and then send a low zero. Then it
will wait for the second minute after that. Again to hear. If so, this is like a veteran
repetition. That means back to the cable point. When this function is called that we
have general goal modes and sit to connect the board and there are optimal
settings for bin number 11 where we connect the LED we define this Ben about it
but just a little out so it can be considered as output. Now, while we need to read
the Series C series line which is C from the tree line it will read the incoming data
using the communication field between us better to buy and store these values
with valuable research values to Brinton. But in the lead set in the window in
Rasberry now if the value in the search read the same as Halo from Arduino and
this sign will Blink x number 11. Number 11 and BlinkX will go here. To execute
this. Then return it. So as you can see empty is a function in Bifold. This is a
sublimation bytecode raspberry. Let this revision to import serial library times and
input-output libraries. This is for these two lines to define the communication
protocol and define the US into serial communication is connected with Albinus.
Links to this data. These lines are a function called Blink when we define the ban it
will use it to blink that these two lines are to define the number 11 as the output to
define the board. Now this one will continue to repeat when going through it will
read the communication data scene sent to the Rasberry will print it. Then it will
ask if it is the same as this line it will blink x number 11 flashing means calling an
empty call function and run the command at the bin number 11 so that it will go
here. It will begin as high then low which means that it will live and death then it
must wait for the fear of instructions. It's for the last bit of bytecode and raspberry
with configuration. I know that I explain the code very quickly but because it's very
simple and we don't want to waste time on this code.
Where we will talk about how I think so how people think of how we
know it is programmed with that and zero. But hopefully, it's not a
programmer we have to write code. Most grams are born through the
use of C ++ and C to very common computer languages. Now you
might be wondering what computer language even has computer
language is a tool used to develop a series of instructions.
Computers can understand. In this case, my computer and I did not
submit a series of instructions that were quite a bit at least in this
lesson. I look into the code how simple Arduino scripts usually start
with initialization or variables to make an integer value 1 and use for
example. This line of code creates an integer value of all calls and
sets a value of 13. Now we need to do something with this valuable
allocated. The next step is to create a function where we will use the
data stored in leading to turn physically and cancel it.
This is making a function from where there is no value that is
returned hence void function in the context of this Arduino program
allows you to configure any physical in or exit what and when using
this line as shown here and then the mod hole this sets the bin
number to 13 And you start thinking about what will be robbed. Let
Arduino or what will change the settings at A because it means 30
per hour. Do you mind what we can? And this also makes it easier to
change the prohibition in the future because we can only change
variables to different integer densities and Adreno happens to be
instant. So it's easy enough to try subprograms without additional
hardware. Regardless of the device itself, you can see a circle in the
image below or if you have hardware. You can't add you just like that
there is still one but lose actual instructions when we know where
digital.
The
basic setting is the power of the board is lowered. As you can see,
the power from the board comes from a PC using USB. If you are
originally for testing purposes, you will connect it to a PC to upload
your program. And when you run it in independent mode when your
program has been uploaded on this board, you can run it from this
power supply input. You install a five volt DC adapter and it will
function properly. Then next to the last ID then select the type of
board. Let me show you. Here I have my Arduino ID because you
can see you have my basic function. This is the code verification
button. This is the code upload button. Then you have a file menu,
you can create a new sketch. Sketch is a program that you wrote for
Arduino. Then you can open a new program, open an existing
program, open the latest program and activate. You even have an
example, a basic example provided with ID, which can work with
various Arduino-based boards. Now move to this sketch, the most
important part is this tool every time you connect your Arduino board,
I have connected my Arduino board to my PC now
This tool is a board available. You can see because I use Arduino
Uno it has been automatically selected but if it is not automatically
selected you can choose the appropriate board
Arduino Uno. For my Mac, this port is USB Modem 1421 You can
see Arduino Uno already selected. Now we are ready. Okay, one
more important thing is here you can see this button this is a serial
monitor. This is one of the good Arduino features that when
executing serial programs, you don't need to have such an external
console or software, you can use the default serial monitor to see the
program. Now after the board and port are properly selected,
As I said, you choose the board then the color port responds on your
PC for a Windows-based system, it will be more or less it will show
you fighter sports. This might progress to 1015 whatever you choose
correctly.
Then
I've shown this to you. Your Arduino sketch. When you remember
the program written into Arduino, because it was written for Arduino
called a sketch. This mainly consists of two parts one is setting, and
one is called a loop. Setup is analogous to normal main programs, C
or C ++ programs. The main function you use is analogous to the
settings
functions at Arduino. And, as the name suggests, the loop function is
used for an iterative looping over instance. it's more or less common
than the file you click on the new one
This
will open a new file and you can try various examples and sketches.
We have Al for this one, this is the verification button. The main
feature is before uploading our code, if you have syntactic errors or
logical errors like that, it will be arrested during verification it will say
your compilation fails. After you pass this verification check, you can
upload your code.
okay. Now, this we talked about this is the serial monitor, whatever
data is transmitted through the serial port is printed on the serial
monitor.
The
sketch structure, as I said, it consists of two separate parts and the
loop section. The function setting is the point where Arduino's
compiler starts the code. It's like a Western animal with the main
function in C and C ++ and various input-output variables in mode do
you need to be as you remember you have 14 digital output pins.
You must explicitly tell your system whether you want to use a PIN in
reading mode or input mode or output mode. Then the loop function
is used for iterations. In this code example you can see we only use
the inbuilt serial port serial port, we only write dot serials starting 90
690 600 is a baud rate you can have various levels of Baud. We will
arrive at us to discuss it in consecutive lectures. You can have
various limits for different systems but 9600 more or less than Baud
levels commonly used for most systems. And in a void loop, you
want to iteratively the Hello Arduino loop. Serial Dot Print LN that if
you write a dot print series, it only prints string Hello Arduino. If not, if
you write LN print is a new line. This will print Hello Arduino in a new
line.
Before this will see the sample code. As you can see in this Hello
Arduino code in word settings, we have written dot serials starting
9600 and in a loop void, we just wrote serial dot print ln, hello
arduino.
Now before doing whatever verifies the code. As you can see, it
compiles sketches. If your code compilation is correct, it's true. It
only shows how much memory is used and all that. If if you are
wrong, suppose I remove this coma point now I verify the sketch it
will give you a mistake. This is a good practice before uploading it
blindly you only verify your code. Okay, now the code verification is
successful. The port has been selected, I upload my code. Now
compile sketches and upload it to Arduino boards. Now, the code
has been uploaded to the Arduino board because the function of this
program is to print Hello Arduino on the serial port iterate will open a
serial monitor. As you can see, it scored Hello Arduino. Good? Quick
enough, we can modify it will install a function called delay,
Say a delay of one second. Thousands are delays in milliseconds we
will delay one second. The code has been verified, we upload it
again. Now we open a serial monitor again. Can see now the delay
has increased mold after one second I hope this is easy. Now let's
move on to the next menu. Okay, like other programs, Arduino Al
supports various types of data that you have in the word bytean
bytes, float arrays, string objects, cat long cats that are not signed.
This is rather similar to your normal C program.
But if we try to compile it, after being compiled, you can see that
there is an error. There are eight simple necessary commas or
semicolons after the statement so that it can stop okay. Let's put a
semicolon or date. Now see that it's perfect, but something to
remember that always after calling a function, there should be no
semicolon.
If you place a semicolon after the function is stated, it will be said
that it is impossible or will show it will give an error. Good. Now the
next thing is that if we call something statement like a statement, for
example, say if, just say if Xis is greater than five, remember
something after calling a statement, there should be no coma point
sign that will be stopped with the help of two curly brackets, it should
be There is no semicolon that must be placed in it.
And other important things their coma in other important functions
are dead. Our founder's curry wire must be a simple coma point
placed or it will give us a mistake. First of all, let's look at the correct
version of it. This gave us a mistake, the mistake was invalid, D was
not stated. Okay, let's explain to give us five. Okay, let's just
compilation. It compiled perfectly just removing the semicolon after
that. This will give us okay mistakes it doesn't.
You can say that you can make an empty statement from it no need
to put a semicolon sign but for better practice that after the statement
is given, like X equal to three, you must stop it with a semicolon.
Let's just check it. Well, the coma is there. The termination of a
statement with a coma point sign comes it makes it compile the level
for compilers and can be converted into hexadecimal values that are
inserted into the cattle inserted into the micro or okay antelope, let's
just sit. After that, we can see that there are two backslashes. Were
they? Let's look at the backslash in Reno used to comment.
For comments, I want to tell you that if I make something like X equal
to five, there is no problem x given the same as the value to just
correct, let me correct. I will see the first line, you can see that
integer x is equal to 13. But if you want to notify some other
programmers or if you want to tell yourself that what your return is,
you can write a simple line in English without Make it enter the
compiler. Give two semicolons after that, give it to do two
backslashes after that and write something the thigh is the exit that is
equal to 13 lines won't enter the compiler.
The line is perfect, but what happens if you want to compile several
line numbers here you can see that there are several liner numbers
compiled. So let's just practice. Thighs are done with the function of
backslash an Astrix for the beginning and something important must
be remembered that backslash then now for termination, it must be
done with a reverse slash for termination of lines, it must be done
with the help of Asterix and backslash. Index symbols, backslash
and Astrix to study sticks and backslash blacks for the right
termination.
ASSEMBLING A CIRCUIT
So now you know what Arduino boards and cables. Time to combine
it into a set. This is a centralized picture of the bread and I will
explain it to you below. By dragging to live to you for the breadboard
as it says only you can have a circuit that allows you to make a blink
diode emitted lightly. So this is quite clear even though it might be a
little confusing. So I will tell you exactly what you mean. First, let me
show you the toolbox requires you not get used to it.
This is the link below not that one of the metal trash canes is longer
than the other. That's important. You have to remember it. Another
thing is a disaster. The eyes of the two sisters rather complicated.
And to fully understand it, I have to explain things like now and
voltage. However, it is not required to understand the use of circuits
does.
Because the Adreno platform has so much support on the internet
that you should easily find a diagram that tells you the right resistor
what you need and where to put it. To make the program take it but
one big charge is like what looks like a resistor. Also, note that they
have a line on them and the lines also beat on the connection above
so you know the direction where the resistor must be installed. So
let's bring the photo again. Now you have seen Bart. So basically
what you have to do is plug your LEDs longer to meet carbon in
2009 and the shorter to 10 resistors that are three hundred thirty
sleeves according to the need for circuits then connected to a
reduced anode. Cullum. You can't except the resistor at Annie Hall in
the Minus column because we know that they are all connected.
Now it's enough to connect the way out if it means we have a way
out of line 9 connected to Kensington and then I will use the cathode
connected to 5 errors and 1 2. I will not get there. Do we know how
all the small holes labelled like on the right is number 13 on the left is
500? Also on that list, there is a ground. All you have to do is block
the corresponding cable and as soon as you plug your cable into the
true Haul, you have to do a few more steps to make the rollout blink.
At first, you must plug in the wire to Arduino. Then you must upload
a certain card to Arduino to make you flash. Now we will learn how to
make it blink. Thank you for watching this lesson. If you have
questions, please ask me and I will see you at the next lesson.
ARDUINO SOFTWARE FOR THE
FIRST TIMERS
The next module is the Arduino software for the first time. In the
thigh module, we will discuss Arduino and what is the red board.
Let's start with the download of programming and installing software
in an integrated development environment and writing our first
program that blinks LEDs or you can greet the world. Before going
there. I want you to go to the graph to go to Google and look for
Arduino.
After
searching Arduino, you can click on the Arduino Arduino button
home and after doing it, just click on the software after clicking the
software you must choose your type of installation. It can be a
window that can be a Mac or can it be Linux for me I have chosen
the Windows Installer after clicking that you will get to the next page
that tells the contributor to download or only for our case now we will
only download after downloading Arduino software will be good okay
I have downloaded it before. So you can see here how the Artemis
installation is okay. Thighs are Arduino 1. 8 points four for Windows.
So it is a file that can be executed. Click just and it will start asking
security questions, click Yes on it. Click I agree. Click on the next
click on the location it will request a location where the agenda must
be installed. For me, he saw the program policy and the Arduino
folder name. After clicking it, it will only start installing. If you want to
see how things and how the library or file will stop, just click Ongood
as you can see here, either in one minute will be installed. Well, I will
only ask the driver to be installed in Arduino. So just close. Good.
Now on the desktop, you can see that there is an icon, named
Arduino. Okay, just look there. If you don't find an icon, don't worry.
Go to C. Go to the X86 Files Program, click on Arduino and there
you can find an icon that Arduino e Xe just makes a shortcut or have
it on textiles and you can start okay, click it will request access to the
Java file click Yes. And now you can see RD. Thighs are integrated
development environments for Arduino here you can see that it has
all the features needed for us for the board if you can park water that
you can find here port and all the buttons needed.
We
will discuss basic topics, operators in Arduino, control statements,
loops, arrays, strings, math libraries, random numbers interruptions
and our example program that will be a little complicated than the
previous one.
So,
the basic operator as a normal programming C, C ++ or Python or
another language you have the same base as the multiplication
division operator plus-minus then the operator comparison if you are
equal to not the same as fewer than, bigger, and all operators, Then
you have a Boolean operator Bitwise and a compound operator.
Moving to the control statement, this will cover various examinations
and looping. So, the FL statement is normal in Arduino, you start
with an IF statement. So, if you have a condition and in this curly
bracket, if the conditions are stated right, if other if the other
statement conditions are correct, or if there is no statement above
the correct, then this loop will be executed. Move to the Case Switch,
you have switches and Joyce has one case option and statement
and then the rest function.
For each case, so, the case option for your statement then breaks
and so on. And in the end, you have a default case after that, you
again have a rest function, then you have a conditional operator it
will avoid the use of conditional operators like this in Arduino. So, it is
a condition if it is true, it will execute the statement of others will
execute the statement of two types of this statement that is best
avoided during Arduino programming.
So, in the loop, you have a base for loops then you have a
temporary loop, you have a do-while loop. This is a pretty common
example you have a nested loop which is a loop in another loop you
can have a lot of looming loops in each other. So, they will have an
infinite loop
So, to run unlimited loops, for example, you all you need, you
develop a system where you need to turn on and off or lights or
LEDs or other distant devices as long as your device is checking.
So, remember from the last lecture, which I showed an example of a
flashing LED. So, you can see, if we put it in an unlimited loop, as
long as the Arduino board is empowered, it will continue to blink. So,
your function can be made more complicated. Instead of LEDs, you
can have motors instead of a motorbike, you can a camera mounted
on the motorbike and they keep spinning you have you can have
many sensors associated with cameras and motorbikes. So, you can
get an example, you can build a security system that will continue to
run as long as your processor works. Alright, and strength is being
supplied You can always connect it to the battery supply to produce
power for it.
then you have a log 10 and you have a square function power
function. The first argument is the base, the second argument
signifies strength.
Then another example commonly used is random numbers. So, one
of the functions of this random number is a random seed. So, the
syntax is a random seed because the capital you need to focus on is
because this is the default syntax for Arduino. So, Random Seeds Int
V rearranges the PSEUDO-random number generator with the value
of B. So, you already have a seed value is the starting point where
random numbers will initialize their functions, you provide an initial
value from it, a random number will produce, then Mac side random,
giving random numbers in the zero range to the high max, then you
have a random mini and maxi, it gives random numbers in the range,
min and max.
Then
move to your interruption has an external interruption signal this is
an external signal that the system blocks the process running now
until it receives the signal. So, you have two types of interruptions
one hardware and the other is software. So, I will give you an
example. Suppose, you are in a circle, you are waiting for the
inspection condition, whether the inspection conditions apply or not.
And maybe from external sources. You get check-in conditions, for
example, you have a digital button or digital switch connected to our
Arduino board. So, every time you press the switch, your system will
flash the LED if not, it will turn off the LED. So, this can be
considered partially considered interrupted. So, this will be an
external interruption. So, as you can see the digital pin for
interruptions and then the pin changes the digital pin to a specific
interrupt number, then attach the digital pin interruption to interrupt
then ASR mode later. So, whether we are known as an interrupt
service routine, it must be defined explicitly. So, these are some
more complicated functions so, we will not focus on this
ARDUINO SYNTAX
Well, the syntax you can say that syntax in programming languages
is similar to grammar in English or other languages. So, syntax is a
method where the program must be assembled correctly. So the
compiler comes compiler can read, you can say a compiler is a
machine used to understand and check the program if properly
written in the syntax and then change the C language that is simple
to understand the cable for hexadecimal language and hexadecimal
language only consists of two parts, namely 1010. Then after that it
can be written into each line can be written in a hexadecimal code
that contains a base of 16 to 123456789 and zero then AB, C, D, E,
F, the thigh is the maximum strength of the hexadecimal value that is
being written next time, about Understanding of syntax, Arduino is
written in C ++. So we don't need to have the basic knowledge for
thigh courses because we do it in practice and can get we get a
better understanding of language if you have a previous knowledge
before you can do it and it will be better for us for now if you have a
previous knowledge What's right for it, it will be good for you
because you will be better in programming and all the other things.
Okay, declare a variable and declare the mould well I say that
variables can be expressed as objects or instruments where values
are included. For example, you can say that x is equal to five
meaning the variable x save the value of five, you can change in
milliseconds, you can say the value of x can be changed US census,
one, eight or anything. Thighs are known as variables, well, what
about when I told you in Arduino there are around 28 pins where
there are 30 digital inputs, five analogue pins that can be converted
into details. So, we have about 10 digital pins and they can work on
arguments. So, we have to declare a pin with a variable. The
important part is that the variable can also save the PIN value as if
you have set a variable as well as I will show you an example to be
written. For example, if you have written the variable x equal to 13 in
you put all places or x where 13 has been returned, you can see that
the program will still work because when the system goes to X, it will
take digital print value x is 13. So will understand that x is the same
as PIN 13. And when we place x at the point of numbers as a
variable, it will also understand
So, let's take it, first of all, we have to compile the thigh error you can
see that mistake because we don't have to stop, there is an error in
the line because we haven't ended. So, let's end up with a
semicolon. Now, please take it as a compiled version, you can say
that the value of X is not started and the thigh is done by me to notify
you that you cannot declare a variable directly without giving a
function without defining the function because it's not Python we
have to declare every variable with The function into that place can
be flexible, can be long or can be a character that I will say about it
in the next section. But here we have to put value in T, okay, when
we have placed the identity of the value you can see that the colour
has turned into blue it means that it is the village index. Okay, now,
check. There is no compile error which means that the X value is
stored as a variable as a value of 13 and has been saved and every
point is okay, let's just upload it to the world. First of all Deidre
Connections Board, Comport Seven Boards, Arduino Uno. Now do
the upload, you can see that it will and then upload.
Now you can see that the flashing board means that this method is
correct. Okay, now let's go to the next section. After that, you can
see that the next part is to run a program at once. While the
difference we must, we must know the difference between running
the program at a time and run it in a continuous loop. You can see
there flash finking continuously, it means walking in a circle. But what
will happen if we run it is once let's just take it we have to put it in F
we have to put it in the word settings, okay for a moment let me do it
coming here to cut all Ctrl X programs written here Ctrl V, You can
see that after defining the program written with the same syntax.
Let's compile alright after compiling it we can see that this program is
written I take the microcontroller here so you can check that it has
been run once or not. I have finished the program it has been
running and you can see that it will blink only for one thing. Thighs
are a method for programs that are running on thighs once called
Void Setup. And if you want to run a program for an old Infinite you
have to put it in one room. Well, you can keep the words empty but it
is not possible for empty keyword settings because the PIN
declaration in serial monitor calls and all functions carried out here
are placed in word settings. Okay now, let's go to the next section.
Here you can see that running the program several times or to run it
for a long time. Okay, let's go back to the program, our ID, we can
see that your ID goes here, select the syntax program in Curtir you
can go to Breeneau between two curly brackets because if we don't
write it between the curly bracket, this will say that That is an a-okay
mistake. Once again Check Integer IDs stated in the desert, our
value of our variables has been declared as the world settings have
been filled with conditions when mod x is equal to 13. It's output
okay, now, let's go down to the word loop you can see that on the
digital word loop right x too high for 100 milliseconds, x equal to low
for the next one hundred milliseconds written in the loop so that it will
write it will run longer for the unlimited room okay let's check and
upload this program is done and you can see that it runs for time
okay okay, let's go back to another part okay after that we will come
to see what function if we run the program for one time nothing but if
we will call values for several times, we need a function where the
program returned for one time and whenever we want to call it
several times we will call the function that just SA Yes Give you a
simple example.
Okay here cut all programs with control x. Okay, after arranged
before Lu V right v o id void glow g l o w you can see that Void Low
has been written gives you two curly brackets, after two brackets
given after it gave two curly brackets, okay. Among them, paste the
program and in the word loop called the function of G, L or W gives
them a parenthesis in ending with a semicolon, you can see that the
function has been called here and the value has been returned here.
Now, let's just take it, we've checked it out, there are no compilation
errors. And we have uploaded it to the board and managed to be
uploaded and you can see there flashing still ongoing. Okay, the
function method is correct.
FINISHING CONFIGURATION
Make
sure the code is uploaded to Arguido and your spirit by the interface. Be sure to
activate cereal and eye to see body configuration. Go with the menu then the
difference. Then tell us a little about configuration. As you can see here then
activate these two to see and serial communication than just click OK. After this,
you must start from Rasberry then open your terminal and run this command. The
first command so that it is installed by Syria for serial communication. So they will
be installed by Syria for Sterling with the telephone serial communication protocol.
Now let's look at the key here is our window. Let's start the terminal OK. Now as
you can see here we need to the right so they will be installed via the phone see it
through OK. There seems to be a problem because I've been told this because ok
we need to put it. So. So don't be kegagey about packaging. If demanding via
Sylvio phone. Now let's continue and activate the web. So bib and so on with the
Syrian kit it seems we need to install Bebkok. Now we need to install the
configuration menu. But let's read the first sentence so I will enter the store and
buy some cereals so that the pie and cereal are ready to burn.
Now let's look at the command to install bib. As you can see here, we have
different ensembles. We need to sort this library but let's say we need to update
the library at first so we get a cash date you can see it update the slub. After that,
we will use this sentence to install bib which we need to install. That is the area of
communication as you can see every time you face a problem, you must find a
solution. Don't just use this problem and finish the lesson or say I can do it you
have to find a machine to look for, someone, to help you look for the onideskok
updating. You need fewer minutes on things than when you come back here. But
let's see what else we need to do. And we need to connect what we know with our
enthusiasm by using unspeakable and carrying out this order allows us or list DTI
devices to register all or to get a list of USP devices or Sierre connection devices
then find online with Dev Ttya C zero or something like Dev. Why is he on one
cheek for my sc, I don't know about Z in one or two that you can see? We have
many and many devices. Here we have the only other problem. As you can see so
we have to edit our code. I am one of them I 0 so open the bison again and
change that I see. Same as serial. Ty se 0 to see someone 9600 to number SE
you have found so if in your case, you get zero then the line must look at the same
as Dev DTT so I zero 9600. But in our case we have one so we need to save it in
one. This is a very important step you have to do so you allow communication
between us all by if you are not 0 1 it will be narcanism communication because
the Arduino board we have seen the Arduino board
THE BREADBOARD
Now, this board is bread where you plug in things to talk about the
plug here you can see in the image below you can use this
customized cable type or you can use ordinary wire and just strip the
tip. They are cables with a little belt plugin. You can call isolation
from ordinary copper cables. But this is easy because they come
pre-cut and pre-stripped. Also, they are collared so it's easy to
distinguish them. Now I have shown you two things. Let me take a
moment for a short time to expose the bread to you. Looks
complicated with letters and numbers but quite simple. A breadboard
is just a short piece.
You don't need it but it will allow you to test the circuit without having
to unite it. Soldering If you don't know when you tie a certain type of
metal around something to hold it together to be used at the end of
the cable, the board makes a specific electrical connection between
the hole so the wire doesn't have to be soldered. The only trick we
need to know is where the connection is located. But I will show you
and explain to you everything. As you can see in this picture so I will
explain every location on the board. There are four areas that need
to be clarified the area number as you can see. We have one area to
three and four regions for areas 1 and 2 other blocks in the
connected area. It's all blogs and Nedia is connected with it. Does
this provide an area for you to control power flow? Which circuit will
have at least one wire attached to it. To block the area on and one
wire installed to block the area to assume them as the rhetoric side
that flows from one and through it through the device to the other
end without the finished circuit. Nothing will happen and from all on
one floor. For the recording area, one with a plus is known as the Y
cathode that it is also a minus sign known as. You don't need to
remember it. I just told you. Area 3 here. Inside there are three R5
from blows that are all connected. For example, if you block the wire
in it to the air block at the left end and the other flows to the earmuffs
at the right end of the two cables it will have a connection and you
plug it anywhere on the board it will not be connected to the cable
there. 12 inside. In your theory, each plug can have or connect
yourself and there is no other place. Area for here. If you connect
these two transport with our wire. The connection will extend to the
line opposite. Why is there on the left and right side of the same
number sharing board. They are not connected. If you want them to
share connections, you need to bridge the gap with a wire. Once
again this is only a short decrease chain that causes cables to their
respective locations. If you want to enter Arduino or build some
nobed sort you don't want to use Beadboard but instead, you just
want SOLEDAD all shared parts. However, bread blades are great
teaching tools.
IF A CONDITIONAL STATEMENT
We will talk about one of the most important things in programming
which is a conditional statement about conditional statements, it can
be a simple statement if.
You can say that in the case of the thigh first of all the first condition
is satisfied then it will go to the second condition. If the second
condition is satisfied, then it will run the statement. I have never been
in the thigh statement the third condition is returned it will go to the
third condition and your thigh can see that it will go to the most
included conditions that are placed in the hierarchy. But if the first
condition is or not satisfied point, the program will jump directly to the
statement while the condition can be placed regardless of each other
without a variety you can say that if five will run where to go to any
condition besides five or six then it will go to the condition is. Okay,
now let's look at a simple example of what conditions and how they
don't exist. Okay, go to Arduino. Create a new document. First of all,
we will write about our LED PIN connected to pin nine.
Okay, first of all, it's indeed the thighs of the Modemurder PIN and
the death of PIN nine as the output or UT U P Pin nine has been
declared as an output okay but we want to see the conditions
happen more or better with the vision of our condition declare the
serial also we have declared inner cereals giving it cancelled from
9600 okay, what is done now goes to the loop void loop we are okay
in the void loop first for a condition we need an integer x okay. Now
go to the condition you can make a simple statement with conditions
like if x is equal to two then the thighs are conditions and there have
been stated. Go to two curly brackets and write something digital w
writer digital writer nine number nine high okay in the program, first
of all, we declared a nine pin as the output that we call a series
monitor after that integer and provide conditions in a statement if it
says Round x is equal to two then only it will go to a statement that
says that the nine digital right is equal to the height and you can say
that it will be a good thing will run for about two seconds. Good. But
if the loop doesn't come out, it will come back and it will run
continuously. Okay, let's just take it. We here will value one. Good.
Upload first compile the sketch and it will be a few seconds uploaded
you can see that if x is equal to one well that has a syntactic error I
have to give it to the same person now, let's see we make a small
mistake and I will explain about it, First of all, if you want to say if it is
the same as you must always give to the same value with science if
you have given it the same as sending a task that says that x told the
value given on the right side that means that x save the value of two,
But if we give A equal to the sign saying that X compares its value to
the right integer that has given anything else does not blink on any
car function. Now you only give an integer value to run it.
Compilation and then you can see that the LED will shine fine.
But if you want to see the situation how can we get a clear
declaration without giving it to a country? Go here in conditions and
read the serial point conditions, okay. Dot TP RI NT LN is important
to write it to the next line after the first line is written, we give X.
Okay, let's post and upload it to the world.
We uploaded it and Ledger CNC then monitored the X value equal to
two. Okay, now, about the L. statement you can simply write e l sp
without braces or anything that goes down writing two brackets.
digital writer. Nine is equal to let's go there and do exponents.
We get it high thigh highs will be high and if the value of x will be
equal to two then the thighs will be low or w and we will change the
value x equal to three. Now in the thigh program, we can see that we
have stated the value of x equal to three, if the value of x is equal to
two, then it will enter the loop that pins nine must below but it is not
possible here because we have set the value x equal to three so that
it will immediately jump to another statement that says that the light
will be high or will shine fine, let's compile and upload we will take a
minute now you can see that the LED shines and if we want to see
the value of x, you can go to The serial monitor and check here the
value x is equal to okay there is an error that I declare that I have
stated the value in it if the statement so that the serial print will not
occur because in the statement and the statement itself does not
occur. Okay, go here.
After a good statement after being stopped, write the X value will
always print the evaluator condition that has been fulfilled or not.
Okay, let's check it given the value x equal to three. Now if you say
there is a value x equal to two, then it will enter the IF statement.
Okay, let's just check you can see that it will take it taking a few
seconds to let's give a restart, okay you can see that the light doesn't
shine and the value x is equal to two. So it has entered the problem.
It has entered the loop if and in the flow, we have stated the
statement that the light will not blow.
FOR LOOP
Well for loops is an important compound of programming that has
been used in almost all types of programming for loops used to run
specific code types. For loops, it is used to run code lines for a
certain period or to take certain intervals or take certain objects. After
that, it must come out the condition out okay, let's try writing to loop
at RD owner not to get an example of his physical computing. First of
all, for loops is used to write a statement for time political intervals
then after you have to get out. There are two methods out, first of all,
default without writing anything else. But the second important
method is called a break from the loop we can solve the loop
anytime we need. We will discuss both now. Okay, let's just, first of
all, open Arduino, open a new sketch and ask for the thighs method.
We have introduced the LED on pin nine. So we will do our work
about it. Okay, let's write some code. Pin mod. M must be capitalized
because of the small-temperature. More LEDs Nine. High thighs are
in parentheses correctly. Okay, and open the serial port. For a better
understanding of this situation. CDL starts 9600 Baud level sets,
okay, now comes here, thighs are part where the loop plays a fine
role for thighs is the word to declare the forum, giving two
parentheses. And let's look at the syntax, first of all, if we want a
variable and if we want it to get a fixed value and it must open
everyone, we must be open to every situation, we must always
create a global variable.
Okay here now what should be after the loop after ending the loop
we are given a digital writer value on the low but process will be very
fast because the microcontroller speed is very fast so we have to
delay for the next five seconds, let's say the light will die for the next
five seconds giving a value of 5000 here and stop the line okay. We
have stated in x the same zero void setup that we call the nine led
equal to the nine led pinaud equal to all output, place everything
should be the capital we call serial start 9600 okay in our word log
has made x is equal to zero x less Of the five x must increase by
each step and add each step. All return statements will run okay, the
Light pin nine will be high for the next five seconds and the value will
be printed on the screen. But after getting it high on x is equal to
greater than or equal to the same five, it will stop the loop it will come
out of the loop and go to the next statement that shows that the pin
nine must below for the next five seconds okay, let's compilation
only.
Take time, no problem. No problem. Okay, let's just upload into the
world. And uploaded done. Okay, let's look at the serial monitor
better for a better understanding. The serial monitor is open at the
back, okay. Let's get it now. The high light for the next five seconds
and after entering the fiveit will below for the next five seconds.
Again it will be high and again it will be below. Think of the brighter
export of better experience than four low we can only introduce
values known as rest. If we want to rest before five, let's have three.
So we can write equal to three do the right curly braces Break B R A
K Break is a method for getting out of the loop. We have written it on
the loop,
See that in the loop we have written x if x is equal to three, then it will
immediately jump out of them for a circle. Okay, let's upload it to the
world. For loops, I save the code. Okay, it's uploaded on the board.
Let's see what happens it's uploaded and uploaded correctly open
the serial port, you can see that on the three it will come out of the
loop okay you see that after the three of them, it just comes out of
the loop because of the break we have included. This is a very
important statement for writing programs and getting performance as
far as hours in a little gain performance according to our needs and
the thighs are about the loop mostly used to call the array value
because it is very important to get the specified reading list for each
value at each step but The best method for calling an array is for us
to discuss more arrays.
WHILE LOOP
While loops well while loops are similar to loops as we have learned
before, but there are some basic differences between for loops and
times in while the loop does not require an increase, during the
syntax loop says that it requires an increase and four uses a
statement Complexes even you can use Boolean statements to run
temporary loops while thighs don't allow for loops. Another important
thing for loops is a very good example of calling an array while the
loop should not be shorter for such an experience. The basic
difference between four loops and temporary loops is that special
loops are specifically simple and controlled loops while one while the
loop is individual and can run at an infinite time and can also use the
Boolean value as a condition that can require it. It can also use the
Boolean value as a condition needed to get an okay statement, let's
do an example of the current loop.
If you want to learn the basics of temporary loops and how they can
be used for different examples of programming that I show on
websites that will give you a fundamental difference between them.
Now you can see that here it returns it for a while the loop time
conditions and for loop conditions are met. Good. Let's go back and
open Arduino and let's write a simple code for violence. As usual, I
have provided an integer value of X and it is a global integer
because this is a global variable with entities as stated before, I
provide a global signature variable so that it can be operated from all
parts of all other programming and then just say that we have
connected LED to pin nine okay.
So, the Declaration of Model B Model B Modenecomma output must
be capitalized as I said before and open the monitor series for a
better understanding. If the word does not change the orange thigh
means that you have made a simple mistake or something like
capital or making small letters alphabet or uppercase or syntactic
errors whatever is done then the word will not change to their default
color for example, to call something, to call something which will turn
into orange let's say that is fixed for all tests. We will sample other
councils in college. Okay, now enter the loop while initializing simple
calls while you can say one with one thigh is the most common
example to call a temporary loop. This will make the LED shine for
an unlimited time. Okay you can see that here if one is called that it
is the basic knowledge of mathematics that is always true, it will run
thighs is an example of a Boolean statement while the loop can bring
it. Okay, let's upload into the upload world it's fine, you can see that
the light will always shine because one is always the same as one
and the thigh T is a known fact.
Now, in a few moments you can do other statements and while you
can say that while x the same as x is always greater than five, the
thigh is the best example. You can also add hikes with solid eggs
such as EXO differences with every step while our loop has done the
activities that are said at the time of the loop. Say that while x is
smaller than five, digital, eight and nine equal to high let's give
delays say 500 milliseconds okay.
Now after exiting it must be given a statement or will return overall
for the loop. Nine low commas will run for the next five seconds. To
provide a description of 5000. In a temporary loop, if x is greater if x
is greater than five it will come out of the temporary loop. Until then it
will run locally adjusted continuously. We can also print it on the
screen. So let's print on the screen, the LN serial series, it means the
next line printing, every value, say it's very good. Now it's enough to
copy all statements and you can also attach it here for a better
understanding of this program. Good. Now, I have stated that there
must be a syntactic error, you can see that the word does not turn
into orange. The same mistake here let's delete and let's upload to
the world. The ledger stores it as a name when the loop. It was
uploaded and uploaded. Now you can say that in a digital serial
monitor, I think there is a place in the code while x is the moeller that
I say also that there is an error now change the syntax uploaded
once more. While x is smaller than five, the light will shine after x is
larger. After a while, x smaller than five light will grow after getting a
value x bigger than five light with light does not work lightly will know
for the thigh light is a simple syntax and we have done it with an
increasing function.
You can see that the loop is running continuously after the temporary
loop has been put in the next line, but you can see that the value of x
is when the X value has been announced and cannot be changed.
So the function will know to allow the LED to shine once again.
Thighs are examples of temporary loops and we have stated that the
book is great considering the difference between them all for loops is
used as a simple loop. For variable declarations, it has a much larger
level of control over the loop. And it can also be both loops can do
brake operations. Now, while the loop can also run on a Boolean
statement like one with one of the physical tools available in the
world like one equal to one, or one equals one or you can say that
two are the same as for anything that can be a physical statement.
And it can also run on the function of the increase method that you
can see that we are here doing the same function as to loop using a
temporary loop but there is a difference in the last value log y always
less than one. In the case of thighs, you can see that when smaller
than five. So last week you will read here are four while if you do the
same function in the loop, the last value is we will read the same as
five in the thigh in while the loop will look for info for five.
USE AN ARRAYS
We will discuss the array, the Well array can be said as an array, an
array is an integer that can store a large amount of value into it and
they all have a specified place or the number specified to call them.
The thigh method is used to store large amounts of value and call
them when needed. We have discussed earlier for an array loop
easily can be easily called with the help of loops. Now we will
discuss the array and make a small program from it. Okay, first of all,
open Arduino. Create a new document, Create a new Arduino open
to make a new sketch now arrive here. First of all, we want to see
the value. So we first will call the value of the Spri serial monitor n
Sorry for this error. Dot serial starts 9600 with brackets alright. Now,
let's get on topics or arrays can be called an integer array, my array
is no difference used for brackets. These brackets are the thigh
syntax used to say that the thighs are not integers but it is an array
of giving the same value to now use the two curly-curses in this curly
bracket, you can put integer values, I say six commas three point
two point six again okay let's say nine coma22 okay see there are
how many elements in array 6832 922 now listen carefully that the
first value array is not my zero eras, but the value. Now listen
carefully that in the thigh array we have around six elements. So you
can't define the first value using my array method for the first value
array starts with a value of 04 if you want to get a print six, you have
to use my array value 046 Let's try it.
Tell Serial Dot Print LNNSAY arrays I use full syntax made into
decades and say well using zero. Okay, stop the line uploaded to the
board. Wait a minute. I just connected my Arduino. I upload it to the
blackboard. And let's just upload. This shows that it gave me a
mistake.
Come see. I played a series monitor from the thigh waiting for a
second. I haven't closed the bracket. That's his mistake. Okay, let's
see now. Just look at the upload compilation and wait a minute.
There are some previous problems, let's just try it. Already managed
to upload a zero inheritance. And it's six.
If you want to call the next value, just add it from zero to one. Now
uploaded once again. You can see eight values that enter the
screen. Thigh is because when we call an array, the array element I
say that it is the second in the line.
So, for one second you use one for the second third use and for the
first you use zero thighs is a method for calling an array, but what
about calling a complete array list? Yes, it's possible with loops as
we have discussed before.
Okay, let's just try it. For silver it might delete everything about
anything else. Right for you two brackets, x equal to zero x not
previously defined. So we have to declare it. x increment okay,
whether the syntax is correct. Let's do two Kurawal brackets. CJ
Load Printer Print LN I call my Array Array Array Call to the method
and what should be the value here the value must be placed here is
x, but there is one problem because of the processor speed. We
have to make it slow so we can see values clearly okay. Give a key
delay of 500 milliseconds, stop the line, compile it. There is no
compilation error.
LED MULTIPLE
We can run it independently while controlling around three LCDs at
the same time, okay first about LED there is a simple light diode that
is connected to Arduino when a detailed pin is high, they are
transfixed when the pain is low. , they will not blow thighs okay is the
thigh muscle theory Okay is the LED theory. Now what we will do if
we want to control a large number of LEDs say that they are
connected to five pins, nine and three, but we cannot control it
randomly. If there is no method if we give if we will write the program
for it will cause a lot of light to the program will be unstable. So there
is a method using an array as we have learned before. If we use an
array to control the list you can control the list or array or you can
control the list or Array Array Array along with Arduino boards and
some small programming methods that control LEDs with a thigh
array are important physical computing parts please concentrate.
Let's start by opening Arduino. Okay, first in the setting you can see
that I have connected the LED to a two pin, pin three and Pinfour,
okay, this is the LED pin so, first, let me make it simpler okay we are
in volt settings. First of all, we will call the pin mode of all the LEDs
so we get to us to give them high values and we get the output we
set it as output we set women as the output okay pin mode to give
both. Give three and give four when the capital-output or TPU TP
minus the error entered now is only copied and entered on three
parts okay. The first function of the Void function has been
completed. Now we will come to the main points, first of all, make my
array give the name to the int LED given a bracket that is quite given
to do two curly brackets to call arrays. Thighs are places where the
array value is stored. Okay, we were given a two pin, three pin and
four pin here okay stop lines. Now, it's only called a loop. Let me
show you an example. Just say d digital WRI TE digital rightlvds l e d
s, give two parentheses and just say. So the three LED pins will
shine. Okay, let's just take the program and we compile it there are
some mistakes and the mistake is to say that let me improve the
program.
This is a simple mistake for dinner. Okay, let's just do it. Once again.
Okay, everyone is my fault, I don't do a value that must be placed
low and give value now you can see that the number one LED will
shine.
Let's just see. Okay, you can see that the LED connected to three
pins will flow. But what about the pin four if you want to test it, you
can do it. Just go there and syatu on the array through it means the
third, the third, you are connected LED number four. Okay, let's just
say. Okay, you can see that the fourth led shines. But what if you
want to call them in sequence and give us a simple example and
give a simple example of a program to work in a sustainable model?
Okay, let's just try it. Remove the line. You can use for our loop.
Whether parentheses, say x is zero, as we do to loop, give you a
semicolon, say x six is smaller than, say three. X is smaller than
three. Do brackets, x plus. Good? Now do two curly brackets. That is
easy. Just write it. Good. Digital rights E D S Le Days do two
parentheses. Be careful by writing the bracket that I have done a lot
of mistakes here and the value we did was X that we provided X and
the statement said that it had to end with a line. Now another thigh is
something you should pay attention to so that the LED is blown, they
can't turn off you to mention that to turn off the LED okay, come here,
copy the line after completing weaving, write three lines and there is
in it our three lines say that the LED value Must be fine, let's do it.
Get rid of a second just wait. And we have to return the height as low
because we want to stop we want to set it at a low speed for a while.
Okay, let's do but for how much it will be done in a fraction of the
milliseconds. So we have to delay saying the second we give a
thousand milliseconds. Good.
Let me explain. So, first of all, we have called pin mode causing
three-four output. Now in the blue world, we have declared an array
of 234 which is the value we call here. For the next line, we have
made a circle that says that LED X will be high to say for a moment,
let me fix it. I will frown for a small version of Lola just need now, let's
try it once again it is a mistake in the program I say led three times
so let me fix it and now let's see 123 stop all women. So, if you want
to see it in the serial port, it can also be done here just let me call the
monitor series is E R I L Dot starting. We can use different initial
values, such as 115200 but there is a higher baud level and we will
discuss it later. In line, you can call it serial dot print ln value x. Value
says x. Now we don't use the value we use the x x value selected for
the second okay, again
Uploaded to the board there are some corrections needed dot series
starting there are two ends corrected uploaded to the board. And
after uploading, the big book, open the serial monitor, the program
will restart and SR 234 closes at 234 seconds and once again will be
closed with the thigh method
We can connect and we can control the list of digital pins that are
connected to other values randomly as possible in the form of a pin
like 459 etc. It can also be used to control analog pins and it is very
useful when it will contain a list of sensors and motors.
Now here let's declare integers saying int before what I am and okay
we have stated in an integer named v. Let's give a simple example to
read the details. We need V to store the reading value done when
two digital pins are lower or low. So it is a simple writer in DIP L
modal R e A. D digital does not turn into orange P number two letters
in our case it's two pin okay, so the LED is a LED pin. So integers we
will save digital print value into it. Okay and just writing a simple logic
the same as OneWe can say it's right excavation digital P number
three high high comacas we also need an assistant. At first, we have
stated two pins like a two pin as input and we write pin three
because the output of two pins will be used to read the value and
three pins will be used to read the temporary value of three pins
connected to the LED to the US and output. Okay and here we have
asked anything for better to improve our practices always trying to
declare integers above okay word settings, we have made it here
okay we and said our initial value from Zero Integer will be a full
repair of the program and Improve okay performance, the first value
of the integer we will zero but after entering a void loop or b, we will
read the value of v number two as a digital number two runs high, we
will be one and if the second pin runs low will zero. Now, for a
statement if the condition is equal to one or we can say height, the
right retail operation number three will be high or will blow the LED
and then for assets when we have to give a statement that if the
value is not the same as one then the light will die or you can say
number three will be below. Okay, let's compile.
INPUTS BUTTONS
Arduino and what I did about what was the last time I would explain
how to connect Washington to Arduino to control the requirements
was a computer in Arduino's laptop microcontroller. You talk to the
city and adapter. If your microcontroller doesn't have our vibart
according to us via cable. But I will not switch minutes and need to
be connected to replace the push button and the contact switch for a
moment so we know is a straight step. I hope not what simple
devices can cause the single-tip circuit button that is connected to us
is usually a low voltage where 5 volts and Arduino are ideal.
Okay,
let it simply download it on the board and see here. You can see the
growth of the light, but if you wish if we give you values from 100 to
200, refer to the brightness of the brighter rear LED 100 and see
where the LED LED is low, but if you Want to see the actual
performance starts 10 See the value of light brightness is very low.
So, if I affect our method can directly provide an output to the analog
pin to perform the occurring operation, write the variables correctly,
we modify the constructor task cycle, which is activated on the digital
converter in analog, which is activated. Is a little in the three
temporary for this reason, which is used in Arduino Uno will provide
a task cycle that can be duly divided 255.
It will be a task cycle. Once again, Mega 255, they will be the highest
point of truth. See the head will be correct. So, if we want to see how
the value is explored or the number of people are returned in the
interest, how many values are stored in the variable that you can see
here say 9600 9600 here and down. Write a printed value of dot
value. We store values in V then we are writing here change the
download OK shiny, okay. See you later. The value is 255 donated
by analog well now allowing you to save 25 women growing with a
very benignant pace and an analog level value is 25. And if you want
to find the task cycle, 255 simple divisions representing about 10%.
of the work cycle of the thigh. is a method for finding the task cycle
and with the thigh method, we can control analog or you can say an
analog output using simple programming.
COMPARISON OF SOFTWARE
Now after we put the difference between Arduino Spirit hardware by the Big Mac
Controller we can talk about software to understand when you want to use one
board or another you need to know what can be done and a little depends on the
software that complicates or for Gather this problem. Arduino is not equipped with
any software Bursar or Blissett has a very basic capability for Brettthe the code
that receives and the Alt-Tab hardware function connected. But the board does not
have any operating system or interface besides the ideal integrated development
environment. And the right side. What this means in practice is that you have to
make software running in Arduino using your ID will make a series of commands
that will be interpreted and act as simple instructions say something like 10 that
lights up for three seconds to turn it off, the green light in the fortress seconds turn
it on and repeat. You can do things that are far more complicated but you still need
to make your program. Fortunately, there is a large Arduino community that
stretches the whole world which means that if there is something you want to do
with Arduino someone might do it. You can see their code modify it and make your
Arduino do exactly what you want.
This is a great way to learn the principles of coding and prototypes too. That is why
Arduino is a suitable choice for anyone interested in electronics or beginners and
any children who want to create something or love to create something. The same
thing with my controller. It has a crazy idea that allows you to write a set of course
that tells the controller what should be. Instead what I spent by coming was
stacked with a fully functional operating system called the recipient. This is for us
based on Debian Linux and made specifically for that body. There are several
other operating systems that you can use with balls that are mostly Linux-based.
But Android can also be installed on what is called the trust built by Rosby on the
desktop. But I think the system for the Billy-Boy Boy beginner system is not the
only software that belongs to the Lund person. There are also some useful
applications that you can use to complete different tasks. One of the most common
uses of spider bite is as a media server that provides the code and Blakes are a
popular application code. And then, you can download the game server application
calculator and even I buy Office Office You know the document, of course, you
can't write your book for us too. That's one of the best reasons to get it for them to
decode by telephone. To lead the code and programming language by telephone
is the suggested language. But C and C ++ Java and Ruby are all installed before
on the board. While Arduino can be tweaked into other Subodh native languages
is the best choice..
Eight hundred sixty-eight three hundred twenty-eight. If you are making a controller
and FDDI breakout board from sport fun or any other store you could also use the
new US ASBI Mini will clarify all of these components next. Now let's see the bars
that are required for you to make your own Arduino board at home. To do this you
need basic bars for wedding bands we know such as a billboard which is this one
entity. W. G. As you can see. These are the whales. Or you can simply use it
anywhere that is available for you. It's a 0 5 voltage regulator which has a 5-volt
regulator. This one this is the item 5 will trigger it or takes 12 volts or mind volt
provides 5 volt built 5 volts voltage for boarding up Arduino 2 LEDs. These are the
toilets for the boiler and the ablation to 220-ohm resistors for the LEDs. One thing
on resistor for the reset button to 10 micro odd capacitors for that Kristen. These
are the capacitors. As you can see 60 megahertz clock Kristen and 2:22 Beco
Fraud capacitors. We need also a small that is normally ORBIN off button. For
example, in the Omron type B-3 path, all of these components are available online
and or flight stores. They are very cheap components. You will make a very
reduced cost.
THE PART NEEDED TO COMPLETE
THE WORK
Old people are bored at home. Now we will talk about more advanced. It must be
available to you to beg the board. First, you must be on the serial communication
board. You will need 50 to three to become a breakout board. There are two
options available from them from spark fun or other online stores. There are after
two or three hours two hours, you we see a real breakout board. There is an art we
know. Seriously you have to get bored. If you plan to use that option and not
Soledad Haydar to the Breakout Board will now be the right time. We will clarify
this option later in this course. The second thing you need is the boot loading
yours on the Chip Maigre. There are several options for clothes or mega chips.
Some of them are included in this tutorial. If you want to boot the chip you use a
breadboard and additional balls you will make your life easier but not necessary.
Ever. Our programming adapter from a fun spark or another online store can do
the job. We will talk about boot loading and why we need to boot or make CEB in
more detail in this course. But for now, you need to understand that. I see where
the ball curse must have a code that will help but realize that it is used because we
know the brain so we will burn the code for this. I see that as some options we can
use to burn the code.
ARDUINO IS READY
Now we will add ASBI to a serial breakout ball to our Arduino Breadboard circuit. If
you haven't added a lot of headers to your Breakout Board, you have to do this
now. Connect VCC from brick with the brick bar on the ground to the ground. So
as you can see here we have to connect these two dams and this land. After you
beat the Syrian border now the board. This is the bend as you can see, we just
connected the Underground VCC in previous lessons from the previous lecture. As
you can see here, this is the underground reason we connected this is a corner.
Curious about what all bends for splash fans. After two-three to break up or just
turn it on. In this situation, we will use VCC to supply 5 volts as you can see here
from there. Being more to your board and x and x as you see here is that x and
here are x we will use both to allow us to become serial communication. Having
come out of the splash of pleasure from the break is this. So you can know what
every bin does. We will only use these two pieces underground to our
surroundings, we know T S D and R S to make serial communication through PS
so you don't need to take off the ball. I see or chip every time you want to program
it. No, it's time to get the speed of the serial offboard. Talk to your new Arduino
settings Connect the DOOR X which has been two in your Mega chain here
number two to x from the SB serial board as you can see. This is number two. It
runs to ex-Penn tea here and our board and is connected to x bin number 3 which
is one of you made the chip to x from US B moved which did not connect Lot X
here from USB to the series board. So we connect T x and x and in the previous
lesson, we can let it slide connected. He said he was on the ground. So now we
have our reading and then he will be ready to be plugged into. Bob and
programmed. But wait, there is another step back. If you build, you will remove the
chip from your underwear. No, it's most likely to have been dropped several times
alone and therefore has been purchased so you don't need to move further in this
story and you will have a fully functional breadboard that has a fully functional
ARDUINO USP functioning up. However, if you buy some extra MAIGRE 328 at
Chip Maigre 168 from an online store, there will be no boot with Arduino
bootloader. Except for fruit trees and dust if you buy this in the food industry maker
they already have bootloaders on them. But if you buy this ice elsewhere, you
have to make what we call the boot loading. What this means you will not be able
to program your harass because it uses a serial break outboard and hardware and
software. So to make your new chip useful for us, we know you have to boot them
and have to do a boot loading step.
Now there is a drum adapter that sounds like you see here to breadboard with
beef that matches the ground why you just thrown at five times. Has chased
behind with a bore. Wow, it just from this is an adapter that we use moving
forward. And this will lead to the last four cables needed by what has ever existed.
Our programmers for loading robot mode. Be sure to refer to us to help make this
easier until it's stupid. The adapter will go to 19 or and we know there are still 30
mega chips you say Ben from your adapter will go to one of your Nigger chips or
us. I have some adapters going to pin 17 or there are still 11 of you, I can make
the chip now. This is a cable that is connected to Andrina chip or makes the chip
almost just a cable or you might be a breakout board here and plug in your six Ben
blogs. Or if you are an adapter, the black knob of six trash cans must face up
towards the mega chip in the next table will show you how to use the software
device box to burn your bootloader. So this is a simple Sibyls without using
Arguido boards that only use every programmer and breakout board.
Time to burn Arduino API and then go to the tools as you can see then select your
board to choose the type of vold you want to use the effect that you will do on your
chip. Most commonly you will use that this says the area of the smell or the latest
version of Arduino for that might be an IAB. However, if you want to boot Arduino
Linley Bad Arduino a lot of Arduino or an older Arduino version. Choose the right
board from here. We recommend this option. Don't argue with seniors after
choosing to go to the Brande bootloader tool and choose a program or you will use
this class we use every hour I will be fine. We only need to choose it. After you
choose your program from our program or we will start loading good items I can
make chips and messages will appear in the status bar here. Which leads to
burning bootloaders to enter the board. This might need a little light to blink on
your program and then you will see this message done by Bender Manbootloader.
When finished with the status bar clothing will be updated with the message made
and bootloader. Your chip is now ready to be programmed using the software. The
bar cycle is congratulating your Arduino and the new Mega chip you will run a
similar Blink program in 13. If this is not the case, try and get it with one. If this
works most definitely successful and you just created your own functional Arduino
board, not on occasion. And I made a chip with the M-K ISP to Celtic and squeeze
Nungarrayi a long period used when it only takes a few minutes. And there is an
ISP Tinney fish much faster. However, there are times when after 5 to 10 minutes
still seems to be loading. I found this or habs. This is terrible checking the data
flow and after giving it a 10 minute time or more I usually revoke verbal or just to
find the building blocks must be successful and have ended for a long time. I can't
this enduro. So and you take all the responsibilities for whatever you have with
your chip. But in my experience, it has been successful.
ATMEL ATMEGA 328 DETAILS
Atmega three to eight details are good we have talked about before
the profit is the black dollar chip on the board. Thighs are known as
Atmel Atmega three to eight P P P, P Q because it runs on five volts
and it is a power-saving chip.
Okay, the frequency is well has a built-in clock that runs at eight
megahertz, but by adding crystals on it, you can see that here the
thigh is crystal and after adding crystals on it, we can run it or
something Stain Megahertz and all Arduino boards With Atmega
three to eight workers at the processing speed of 16 Megahertz. And
the next section is flash memory or you can say it's just
microcontroller violence. It is 32 kilobytes, and I invest 32 kilobytes it
means that it cannot store photos or other data but is made only to
save the program written on the chip. This program is written on the
chip in hexadecimal form, but we have to program it in Arduino's
idea in C ++. Will Will Arduino is a special form of C ++ which is very
easy to use and can be used for non-professional sounds about the
PIN. It has 28 physical pins, well you can count here it has 28 more
than 28 pins because the land code has been given twice and also
three to 313 power adapter is also added to the board and three pins
for input-output reference. Good? The next point of digital moulds
well on board you can see that it has 30 straight digital pins. Well, I
want to tell you that first of all considering that zero print and pin one
or should we use it for processing because if we do a serial
connection and if we use a zero pin and word pins there, then there
will be a mistake in communication Serial so we have to choose that
we don't prefer zero pain and one pin for our programming and other
purposes. It has five analogue pins like Zero A two fives well all
analogue pins can also be used as a GPIO digital pin bus, but not
the point that zero pins must be written in detail with 14 and one
digital pins for PIN and so on.
Okay, simply start CC engines and their types first of all the CC
engine, is a simple engine with two wires, you can see here that two
wires. If you want to change the direction, simply change the polarity
of a positive connection and another negative and if you want to
change the polarity, reverse the wiring and it will change the correct
direction of the thighs is a CC engine. Ok, then what is our stepper
motor? Well, first of all, it will be the servomotor.
A servomotor is a special type of engine used to give the values in
degrees. It is not made to rotate continuously in a continuous way
360, it is intended to rotate during a specified degree, if you set the
engine to operate at 30 degrees, it will be locked itself or 30 degrees,
it is will connect to 30 degrees and when you try. To change the
engine direction if the program is running, it will arise to such a
degree. Very important motor thighs area for the manufacture of red
toy aircraft because the thighs are a very important engine for the
manufacture of toy aircraft because for rudders if you want to define
the value of 30 degrees and that it will cause an Another effect on
deletions while the engine is running while the engine will turn. Back
to 30 days so that it can move to the urban Verizon, the third type of
engine we are talking about is here is the step by step, the stepper
motor.
The third type of engine we are going to talk about here is not
motors. Stepper motors are two types, they are a unipolar engine or
micrometre. They are specially designed motors that can operate on
computer controls such as the row motor, but they are used for more
than 360 degrees of execution, they are useful in the long term,
especially in CNC printers and 3D, they can be very high-speed
motors, they can be a very low or very basic engine, they have a
simple execution mechanism that is set as a coil inside. It is a
magnet that magnet is rotated with the changing value of the
direction of each coil that activates the movement of the magnetic
coil is with the help of a pulse during its driver. We are used to
amplifying the computer pulse in high voltage pulses to execute the
engine, OK and the last type of engine we are going to talk about the
DC well The last type of motor is a DC motor without Broom or a
blocked motor.
The DC engine again is similar to the step by step, but the basic
difference between it is the basic difference between it indicates that
it is a free-bowled DC motor means that the effect Functional engine
is similar to the CC engine. The mechanism is similar to a stepper
motor, but itis used for very high-speed operations, such as
quadcopter rotors, all the rotors of the quads are only connected by
the block engine because they are the lightest 'They are the most
powerful who are the most powerful. speed and they are the simplest
types of movement. They are the simplest type of engine for high-
speed operations, they can be controlled using the pulse width
modulation and specially designed drivers that you can say that
electronic speed controllers in the long term. Quadages are also
linked to the micro-mantra mostly. are 32 bits to control their
operation.
SIMPLE DC MOTOR
We will learn about the engine and how to control the engine with the
help of the R & D on the part of the RD of all the contents man of the
legislator or the contents is a type of motors that can then contain a
direct current engine, A simple driving motor servo engine, then after
we are going to talk about the step-by-step engine and in the last
three tutorials, we will learn to the controlling nature of the engine
and we need to experience controlling the engines. Okay, let's start
with our first topic. Before starting the type of engines, I want to tell
you that about an engine is an electromechanical instrument that
takes electrical energy as an entry and gives in the form of
mechanical powers that there are two types of Engine in the world
The engine AC in engine DC in Arduino, we are mainly talking about
low voltage CC engines.
Okay, simply start the DC engines and their types first of all the CC
engine, it is a simple engine would make the reason you can see
here that it has only two sons Whether you want to change the
direction, simply change the polarity connector. And another
negative and if you want to change polarity, reverse the wiring and it
will change the correct direction of the thighs is a very next DC motor
What is a stepper motor? Well, first of all, it will be a servomotor is a
special type of engine used to display the values of degrees that it is
not made to run continuously in 360 degrees, while it is intended to
rotate for a specified degree. If you set the engine to operate at 30
degrees, it will be locked itself or 30 degrees, it will connect to 30
degrees and we know that you try to change the direction of the
engine. If the program is running, it will take place except for
Saturday, the AREETHE Treethe thighs very important for the
creation of Toy Aeroplanes in red. Because the thighs stop a very
important engine for the creation of toy aircraft because for rudders if
you want to set the value for 30 degrees and that will result in
another automatic effect repressing until the engine turns on 30 d so
that he can move the urban very easy. The third type of model we
are talking about is here is a stepper motor, the step by step, we are
the third type of engine we're going to talk about here is the step by
step, the stepper motor is two Types, they are a unipolar engine or
vibrating. They are a specially designed engine that can run on
computer controls such as the automatic engine, but they are used
for more than 360 degrees, they are useful in the long run, especially
in CNC and 3D printers. They can be very high-speed motors, they
can be a very low or very basic engine. They have a simple
operating mechanism that is said as a coil inside, there is a magnetic
magnet is turned with the changing value of the direction of each
individual coil that activates the movement of the magnetic coil is at
the Help of a pulse while the IT driver is used. To amplify the
computer pulse in high voltage pulses for the engine execution and
the last type of motor we are going to talk about the CC well and the
last type of motor is free-bowled DC motor or BLDC engine. Well
listen to the engine similar to a stepper motor, but the basic
difference between it is the basic difference between it indicates that
it is a broomless DC motor means that the functional effect of the
motor is similar to the CC engine. The mechanism is similar to a step
by step, but it is used for every secondary school operations such as
quadric capturing rotors. All quad copter rotors are only connected
by the BLDC engine because they are the lightest, they are the most
powerful that in terms of speed and are the simplest type of motion.
They are the simplest type of engine for high-speed operations, they
can be controlled using the pulse width modulation in specially
designed drivers, you can say that electronic speed controllers in the
mandate. Quadruples are also linked to Micro Montura. Most of the
time are 32 products to control their operation.
Simple DC engine. It works its diagram and how to connect it with
Arduino to get the motion. Okay, first on the CC engine, I want to tell
you that their CC engine is the simplest type of engine you've seen
because the thighs are a very small device. You can find in the toys
that you have seen here the engine of the photo thighs has been
taken outside the toy. And here is their CC engine, you can see the
B engine. They both have different design, but the thing is that they
both run on the same principle. When the power is sent in one
direction, it will turn clockwise and when the power direction is
changed, it will work integrable. First of all, the CC engine can not be
connected directly to Arduino, it requires the execution of a specific
driver or transistor. Because if we connect the CC engine directly to
Arduino, it will attract a lot of power that can eventually err and you
know, sometimes, the laptop can also be injured because of the
thighs. So, to control a DC motor, we need a driver or a transistor
configuration to execute it. Okay, just see the CC engine. Here you
can see the operating principle on the DC motor is a DC motor
outside the body, there are two magnets such as the North Pole and
the South Agreement and inside the coil every time the load is
passed through the coil or the contact centre, so the engine here you
can see that these are the pressures of the context and the thighs is
called that the suburbs are a copper ring divided into two Parties,
whenever the current is paused here, it will force the engine to it. will
force the wire of the coil to enter a thigh direction is because of the
law, the thighs are because of the rule of right of the engine where it
was motivated by the fact that it was given by thighs ok OKS are
known as the rule of the Right thumb of Fleming. You can see here
let me make a correction for you. The thighs are the correct thumb
rule. The three fingers are in other directions. Okay, let's just see that
while working. Here you can see that whenever the loads pass the
engine will turn in one direction or when it comes to the centre point
here. So, contactors change direction and thighs work as a
mechanical rectifier for the CC engine to continue its motion in a
direction. The important part, the Sleep of the split ring is a
cooperative divided into two or more parts. The thighs are the main
reason for motor movement in one direction because when it
happened here 90 degrees, it automatically changes a height
installation as a mechanical rectifier and the thighs will give the
engine a continuous movement in any Which specific direction that
the current has been controlled in the direction of the engine
direction, can we change the equation here, less start and it will be
given here more than this will automatically change the direction
from there.
Now let's see how to connect an engine to the Arduino here you can
see that it is running on the rule of the left thumb, but I showed you
that it works to the left of the room here, the thighs will cause The
engine leadership. Just see on the drivers here you can see that the
thighs are the driver we will use here to manage an engine, okay,
you can
SERVO MOTOR
We
will discuss the servomotor. Well, what is a servomotor, first of all, I
want to tell you that the servo motor is not similar to a special does
not look like a simple engine running in a progressive direction while
on the other servo The engine is a kind of engine. This is fixed for a
specified value, it can only turn from zero to 180 degrees and it is not
possible to rotate it more than that in many servers? While some
servers can rotate 360 degrees complete in continuous rotation. But
the main advantages the main use, but the essence that the
servomotor is used that the servo motor can define a specified
degree, if we define a servomotor to more than 30 degrees, it locks
to 30 degrees in any condition that will occur in Moses or any
condition that occurs at the motor of the servomotor in any direction,
the servomotor will refuse it and return to the position, it will return to
the part that is set to the example of 30 degrees. . If you set a servo
motor to move a direction to 10 degrees in each second, it can do it
like that 123456 and up to 10. If we want to define it to five degrees
and exactly five degrees precisely, it can be locked on the Five
degrees. Well, there are many servo motor applications than the toy
plan helps the reader control the results of the traders by servo
motors. The reason because it is when the servomotor must be
pressed in position and when the air flows on the wing, it tends to
move the wing in the rear direction opposing the servo when the
servomotor retrieves the version and that the values are clear. I have
a document on the internet, I received a document on the internet,
which can help you get a brief knowledge of the servomotor, see
here our servomotor There are many shapes and sizes some are
industrial engines able to turn permanently to 360 d eh well, the
servomotor has a basic design see
The design carefully, the thighs are the control signal or you can say
that the thighs are the Arduino, the pulse wood converter we talked
about is a DC. Now, coming here the cooking is the waitress part of
the thighs part is a comparator of a small tip that is implanted in the
servomotor and the thighs are the position sensor that you can say
that a simple potentiometer cook is An internal amplifier part of the
chip and the thighs are the motor. The thighs are the access of the
motor when the Excel must rotate 30 degrees, it will compare its
position here and it is indicated that I will position it as zero degrees
so that it will give an error here and that the error will be amplified To
define the rotation of the whole servomotor seeks to return to 30
degrees when the motor switches to 30 degrees, the data indicates
that there is no error, he said he wanted 30 degrees and It is 30
degrees, there is no error. Thus, the value defined here as a burden
or two more than 30 degrees has been recorded here by access and
displacement of 30 degrees. Whenever a change is made on the
server, it came back to its location, it becomes at the tip of the thighs,
but now we need to discuss how to connect a servo motor to an
Arduino. See here, you can see that there is only one second there
are three pins in the servomotor, they are as follows. The first is
yellow that is for the signals that the red is for a five-volt output in the
black is for a power voltage. Just see in the diagram I made a
simplified version of it. Here you can see that the yellow wire is for
the signal connected to the analogue pins of the Arduino.
The Five WorldSare are connected to the tray and the ground is
connected to round pain, but can I need to mention something easy
if possible, give the server or the individual power supply because if
you connect the servomotor directly to Table and engine that has a
size like the thighs will create large disturbances and a large amount
of power possibly frying the card and can also cause damage to the
computer to move continuously of a heavy torque servomotor and
heavy motion, it is recommended to use an external power supply
and connected to the ground and then send the signal from the
Arduino for the movement of the stability of the tip of the servo
motors and the protection of the servomotor and the mother. You can
say that the Arduino table is fine, the thighs were the basic
description of the servomotor in what follows we will use a
servomotor and controlling it with Arduino with an example. About
servo motors, I want to tell you that there is an integrated library in
Arduino that can control the servo motors. You can see here the file
ranging from examples and go to the examples and go down, you
can see that there are two programs built into the Servo Motor
application. Here you can see that the default library of a servomotor
is called the library that receives an object and the object is selected
for all operations. Here, the object is said that the servomotor is
attached to the pinning of the Arduino board, okay, the pinning will
give the modulation line signal of the pulse width for the servo motor
to rotate. And here you can see that the pin in Pinyon can say that
putting an analogue spindle is called a pin. Just edit. You can see
that the analogue spindle is called here, you can edit here you can
see that, there you can see that the analogue spindle is called pine
three and whenever the playback at the analogue spindle has
changed playback to the servomotor will observe the analogue play
or spindle and give a direction of movement and the angle that is
here, you can and give a value that you can see that the value of the
integer is defined by the function using the function card. Here you
can see that in mathematics, the value of the digital the here you can
see that the value of the analogue input is given as 02 1023 and the
movement of the servomotor is zero degrees to 180 degrees here
when the value of the potential meter, you can say that it is 255 or
555, it can take the servomotor at an angle of 90 degrees if the value
of the potentiometers changes the angle of the servomotor, the angle
of the servomotor also changes and the angle writing is performed.
with the help of the function. My servo was the item and is done by
the written dot function and the value is that we have valued the
variable that is the value performed by the function of the thighs
card. Thus, this can give you a value at which the movement of the
servomotor must take place and the value, to which the servomotor
must stop.
Okay, the thighs were on the ballistics of Sarong on another
conference. Just talk about another servomotor program. Here you
can see that the scanning is a much easier program because it used
a servo directly and later to rotate 180 degrees to zero degrees and
vice versa, it does not require a potentiometer for its operation, It is
simply connected to the new spindle then it uses a loop for the
variable position you can see that the variable is increased from zero
to 180 degrees with an increase of a degree of 15 milliseconds if it
reaches 180 degrees, then again when the position value increases
at 180 degrees. Taken at zero with decrements of a degree. And all
the values of the servomotor were written in the object to the
servomotor by the correct function as a pose and the high-end have
a difference of 15 milliseconds. Well, these are the basics of
servomotor and servomotor programming on how to control it with
Arduino. Well, the thighs were the structure of the servomotor we
talked about here.
It uses a simpler engine and there are some electronic devices
behind a potentiometer and these are the gear timer hearing a
potentiometer is connected that gives the value to which the servo
how to stop or to which the servo how to reach The servo. By the
value employee, the value correction was carried out, the correction
of the value is performed by the pre-integrated comparator in the
servomotor and the value of the signal input is taken with the help of
Arduino so that the Arduino can control the servomotor to reach a
specific degree. These are the different types of servomotor and you
can see here an AC servomotor constitutes an industrial servo
motor, which has a petition positioning encoder rather than a
potentiometer to give very precise values so that it can work very
precisely here. A similar servomotor that we have taught is called
continuous servomotor because it can turn on the Indian rotor
continuously 360 degrees several times, you can see it here. You
can see here that it can rotate continuously. These are the spatial
servo motors that do not have the spindle that does not have the
physical part that prevents them from turning permanently and that
they are a potentiometer are of good quality so that they do not
deteriorate Potentiometer will run continuously 360 degrees.
STEPPER MOTOR
The Arduino has built-in libraries for the movement of the servomotor
as well as for the big book to see them here when you produce an
example, you can see when you go see the design of the library for
good here, you can see this engine. Norm A revolution one step at a
time in the speed controller has just seen them..
First, the motor node is a library used to run the engine. Or you can
say that it simply defines the pinin that the Arduino can be
connected, let's say eight 910 11 and the variable is the steps. The
steps are the variable that slows the number of steps to be taken by
the servomotor to achieve a specified value. Here, these are 200
steps, it means that the engine runs from zero to 180 degrees, you
can manually change the steps of P 60. or what you want. Let's see
another program now. And still, go to Stanford, you can tell a
revolution.
A revolution is a small program of the thighs we simply say that the
engine of the motor pins that are connected to the night 910 11 we
must all route them, every 200 steps to follow to obtain a movement
of complete revolution and return to its initial position. When it has
been started, the movement can be tamed or can be controlled by
controlling the speed in the thighs, we can see that the motion is that
every time difference of step has 500 milliseconds or half-seconds,
you can also write them under 50 milliseconds. So the engine will
work about 10 times faster than that, but you need to change the
time direction of the card, you may have to change the edge time
value of the variable so that it can give a clear rotation. If we modify
the value for one, it means that the engine will have an evolution
injured in a second and an outside gamble that it will rotate 10 times
faster to get an initial version so that it is better to change the value
of the two locations so. that you can have a gentle movement in both
directions of another legacy that other parts are a motor step at the
same time the thighs is a program mainly used for taking the step
and is also used to obtain The precise value of the stepper motor.
The thighs program is used to get the step precisely unnecessary
that you can get the wider interval that you can get this by the
interval of a step, you can see that you can the angle that the
stepper motor built from the previous one to the current location. . In
reality, it is 1 8 degrees but sometimes it can also change due to the
micro-stage you can change 1. 8 degrees to 200 times more clearly
or you can tell it that you can divide it into 200 pieces to get it A
better-clarified value. Well, the thighs method is used for controlling
motors used in 3D printers or digital manifestations because they
require a high level of accuracy and higher accuracy for a high end
for the level of High accuracy. The degree of stub must be very
precise. So, they use micro-floors, we will talk about micro-stubbies
afterwards, but let me give you a small overview of this step can be
done in three parts. Let me show you the difference, okay, you can
say
that it is identical to the modulation of the pulse width if the pulse is
false, it can make a degree, but if the pulse is very slow or if you can
say that the service cycle is very small, it Will give the value to the
engine node of a degree a node of a point, it will not give the motor
to move 1. 8 degrees, but it can also control it, engine half a 1.8
degrees to a quarter of a quarter 8 degrees that anyone 200 the part
of a two and eight degrees for this process, the micro steam is used.
I will show a diagram for one second here you can see that the
example of the micro-stage thighs is a complete cycle of rights that
has been divided into four basic steps so that you can say that
everyone has a difference or 25% of the service cycle. But the thighs
can also be broken into small parts here, you can see that the thighs
are the method that allows you to see that each part is broken in our
seven segments or so, that it can give a value From one of the four
intootantven who will take you more than 28 by the value of the
stage that should be done so that it can give a very precise step to
take. The whole cycle is 1 8 degrees present, it can give 1 8 of 28%.
At present, this can give 1 8 divided by 28 and it is the angle. The
micro-stage is the most accurate step that is most accurate step can
be taken using a specified driver. But remember a micro-floor thing,
but remember a micro-floor thing, it's still to use a 32-bit card and a
32-bit driver to give a verifiable use in the industrial force, in
industrial equipment. , All step-by-step engines are controlled with a
32-bit arm architecture microcontroller and 32-bit driver. So that they
can give a very good precise value and they can operate at very high
speed. Okay, the thighs were the theory on the motor step by step
here, you can see the Arduino the wiring cooking driver, the external
battery source and the stepper motor here. We talked about the
program in the chapter we are going to perform an engine, not for
practical purposes.
RUNNING A DC MOTOR
We will talk about operating a DC motor with the help of an Arduino
card and driver, we can not run a DC motor directly with the Arduino
because the DC motor attracts a large amount of current in The
current thighs can easily fry the Arduino card even in your computer
or laptop.
Come here you can see that the thighs are high for that moment for
10 seconds and another direction for another 10 seconds is our
daughter PTL N Print LN you can tell the counter-clock Wiseor
counterclockwise finish the line and Write the day of 10 seconds
12344 agreements ok. Oh, now give I give them water for your
understanding of the loading of the program. And let's say with a DC
motor. Okay, so in the program, you can download all programs at
the start of the module in your presence that you can get the
program okay, it takes a while. Okay, simply opens the serial monitor.
Let me open it once again. Now you can see clockwise for 10
seconds. It works continuously, wait for a second to come. And you
can see that it turns in another direction. Well, by the thigh method,
you can control the engine in both directions and you can get a keen
sense of clockwise and counterclockwise by changing the polarity.
RUNNING A SERVO MOTOR
Well, a servomotor is a special type of electric motor used to give a
precise degree of value. It is not used to give a continuous rotation
well to connect a servo motor to an Arduino, it is very simple that you
can do it by connecting the yellow wire to signal the red to five volts.
You can connect it with something yellow wire to report or that you
can see the pin that we have set to control the servo-five volts wire
will be connected to the red wire will connect an output of two to five
volts in the ground wire. to be connected. at the land terminal of the
Arduino. Yes, it is good to run small engines, but if we use weak
servos, it is necessary to display them with an individual power
supply. Okay, let's start now with the completion of a core. Okay,
come here. Yeah is a code that is a library is always a good library
for the control of the Arduino control controller, but we want to write
our code? So we can first go here at the top, especially we call the
library I we call the library by writing Include I NC Read will change
the colour that means that the servo is resistant to servo dot. Hs is
the extension of file C okay. Now we are the rights e r V also a line
will have my m so, or you can just say that my it's good. We give
high my agreement. Now, in the word configuration, we need to
define the positions that should be in bulk or vo go to the top, we
must declare an integer for the preservation of the value of the angle
that must be taken in the stage we declare That I declare I nt in gl in
gl is not possible, so simply say d, for example, for example, it
means that the degree of agreement is equal to zero. Now, come
here says M while it's the good Girl Empire has TT SC, H is that we
define the server number p number three. We, therefore, call why
not attach the number three PIN connected to the service. Now it's
very easy to control the engine for 32 at a fixed or 30-degree
location, simply write my adult DR WR I TMY right straight 30 I will
use are variable, now, I'm just trying to do you like SIM possible.
Okay, the last program is running. Juice Thorold for a second but the
symbols will be removed from here. We are declaring. Now
downloaded. Here we must define my setter before, okay, come, cut
it here. Okay, simply download the monist demonstration. Let's go
back. This is the compilation of a second. Wait just a second. It will
be ok. And it is that S the Servo was taken the position of the
legislature at 30 degrees for TD
Its thighs occurring are the motor of the thighs is the control method
of a servomotor that you can write it manually that you can call a
program, give it a logical function or if you wish, you can simply test
it, you can simply take the servo. Engine by the cooking motor on the
control of the servo motors. Keep in mind to run heavy servos it is
better to give them a personal power supply connecting the ground
power supply also on the microcontroller plane, then use them if you
connect a servo directly to the microcontroller, it can damage the
Microcontroller. as components.
ARDUINO BLUETOOTH
There
are only a few connections to do. So, let's start. As you can see in
this Arduino table, we have these plastic socks with numbers next to
each socket. OKAY. Now, these plastic jacks have several Dunbar
leaders and we know the bins that the Arduino microcontroller used
to interface with the outer wall and these pins, we connect to
Bluetooth a lot and the resistance and resistance for tests. Other
bands. Benzédrine was a point x and t spend these two people as
you can see all X X 0 and 1. They are angry and one of these will go
to X or X and Bluetooth will make every 5 volts and Incredible
Arduino Benn's will provide VCC or the power of this Bluetooth
motherboard that is here. The hints which are the soil will offer the
ground to the Bluetooth module as you can see here on this black
cloud will get the ground from the one we know and we will have this
sort when you receive 5 volts on what you will of Arduino. So, these
four songs are the connection to the Bluetooth that you want. So we
are managing and running. Then we connect Negative Alid on the
ground here because you can see why the positive fold 15 with a
resistance value between two to a child. So, it will burn you if we
connect directly 5 volts will go through this advance. Why it only
works at 1.5 to 2 and 5 volts. We must therefore need to store to
minimize the trail volts. Then we are good to leave. You have
finished with this circuit, but please do not connect our thinking x x
and x to x as you can see. You must connect our X we know to t X.
Since RX means that it is evolved out of the arduous or a c or c of
the signal of this transmitter of a little with these tonnes for the
transmitter and vice versa the transmitter and the Arduino send data
to the truth receptor. So, each will be connected to the other not the
same as all the other watches are here at T and T to be turned off so
as not to connect neither x nor x anti x 3 x nor with two or three no,
you will not receive Data here The X means transmitting and RX
means receive.
Let's start by talking about the futuristic wireless electricity range for
two centimetres of electric transmission to three to four meters
depending on the equipment you have. Scientists work on the
extension of this range and should become 10 meters in no time. As
you can see that a source code is connected to the mains power can
transfer the energy of the electronic devices of this part. It's all the
barn with a silver reel. This is the laptop with Steve Alcorn. This is
aligned with Steve Alcorn because you can see all these well-
received receiver coils from this transmission piece and will work
wirelessly. It is therefore an example of using wireless electricity
transmission within ours, as you can see. It's about four meters wide.
Now, as you can see, these are three but batteries can be loaded.
Simply place this unit to tell one of the surfaces. This is a surface
used when it's a lot of surfaces. You can simply place your device
and will be charged wireless without having to connect. Let's say a
cable. You must be able to load it. But it's a very small distance that
you can see. You can load it by turning your hand. It is therefore a bit
of our booth to sit down, but they work to solve it so that this system
can be achieved with high efficiency. More than 40% This is another
example of electric car loading using writing, as you can see, an
electric car has a battery and this battery is loaded using as you can
see here. The coils are connected to the AC boiler. They are
transfinite with magnetic waves. Current wireless technology is
implemented in the Bluetooth Wi-Fi connection and APS-C
communication or near the satellite communication of the
microphones mouse wireless mouse and headphones. These are
examples that use wireless technology in general. And here we are
talking about wireless power transmission. Now, what do the
products of wireless power transmission look like? This makes them
more practical, with no manual or charging or changing batteries. It
eliminates bar codes unlikely and expensive. This makes the devices
more reliable. It is never missing from the stack to use a product
failure. It is by repairing the lowest link to the environment. Of
course, because it is reduced to use lots and a lot of wires, it has
reduced electrical waste. So you do not have to throw cables and do
not have to keep them, let's just add copper wires on your network or
more and more devices that you can boil wirelessly to reduce the
quantity of waste and help you reduce help the environment.
HOW DOES IT WORK
You can download the Android application from here and the source code of the
entire project so you can change if you have an earlier Java experience. Now, how
to use them, do not know the application by here from this link that you and WD
Tooth Comber Slash and Slash Arduino Bluetooth which is our official website or
the other link. If this thing has not worked now after being on this website, you will
find the download link in this article that will be as you can see here. This is the
download link you will get from the article and you will be directed here to this very
folder. Now, as you can see, we had an ad megabyte file that is and this zip format
you must unlock it and start downloading this farm. Now, once the download is
complete, close it and go to where you downloaded this right click then extract. So,
Arduino Bluetooth as you can see. This is our file. Once you have entered this
folder, you can see that we have your files. This is the Arduino code. This is the
beginning and it is the zip file for the source code of this large file. This file is
basically what you will download and install on your phone. Now, for simulation
purposes or will use an Android simulator for the Windows environment. You can
get it by going here bright blue stocks, as you can see that Blue Stacks is an
American technology company that uses the Blue Stuck drive used to simulate the
Android system on your Android Windows operating system for PC and Mac. If
you went there, you can simply click here download bluster and just wait. So you
can go there. As you can see here, it downloads. But since I downloaded this and
install it, I'll find it here. Blue batteries. That's all. Now, as you can see, it will take
time to start that. That's it. This is our simulation. OB Stocks It will take time to
download everything. I did not think about the specifications of your computer as
the graphics card and the Sibiu. Now once you have had once your office, you can
simply check these options as you can see. This one is the one we need. We must
install it. OKAY. This requires the location. We must therefore copy this location on
the best to tear this. This is our biggest finding simply double-click on this case and
now, it installs an OK key, you can see that it has been installed. Just click this to
start our application that is covered. He asks us to do something if we want to
continue using Bluestar. OKAY. And it's thought to continue. Now let's go back to
the main demand. OKAY. It looks like we need to get these applications installed
before you can use this software. OKAY. Now, it asks us and I wanted to activate
Bluetooth. Just click Allow Bluetooth shoot on. This is our first plan, but as it is a
simulation environment, we could deal with problems because there is no
Bluetooth. What you want for this environment. I just wanted to show you the use
of the interface. So, let's go back after running the software and once turning and
go with the truth, you have to build your device with a C. 0 5 0 0 5 0 2 0 6 2 What
you will turn on I see 0 5 0 0 0 6 Luthern then scan for available devices using a
mobile phone invoice to see 0 5 0 6 by entering a different password or says one
two three four or four zeros. It's the first step for running the software and build
your Android device with the Bluetooth that you have. As you can see, this is the
user interface you need to click on your devices, then bless their devices, a screen
of your party to lift your Bluetooth what you go from the list that is seasonal 5 or 6
0 6 After the connection successfully entering the PIN code 4 0 or 1 2 3 4 Press
the key, then on this cover that is connected to UP, we know on this basis to turn
off this light that is connected to one or the other you know when you're done. Just
click on the disconnect button and you must go then turn off your router what you
are. There is an interface for the application. After downloading the file and install it
on your phone. It's for this lesson on the Android application. If we returned here
as you can see, it is faced with a problem telling the Bluetooth truth your sins.
There is not here. In simulation mode, but you simply transfer a file to your mobile
phone and install it on your phone. Since it's Bluetooth, you can simply discover
that it is 051 you all and everything will be able to go there. That's it for this lesson.
Thank you for watching. If you have any questions, please ask and you are on the
IBAR. That's all for the moment. It is educational engineering.
SCHEMATIC
This is for us to weigh on everything this is the USP programming
cable that you connect to your computer and it is also used to look at
what we know in some cases if you do not have a lot of
Requirements, this is the decision you connect. BHULLAR 5 VOLT
SMALL Supply for this if you need more requirements from the
Board of Directors. And as you can see, these are the sockets that
interface the Arduino on our microcontroller with the other for this dx
and our zero expense and the one connected to the XX as you can
see here connected to the x in the wall DXI take place to start in the
window out of the window. And these two sons that the Earth and the
VCC are connected as land and VCC for the bolts for OPs on them.
Arduino is Arduinino Boring The Bluetooth module using these two
red and black wires. This is a quick conversion for a schema. And as
you can see that number 13 is connected to this store and the
positive terminal thereof, why this negative minute is connected to
the bottom on board. Then we will talk about why we connected it
has been about 13 years since we would use it in the Code section,
but that's it for the schema. This is the final version before going to
the code.
CODE
So, try the code we have to know that you know I just know how to go to the man
and hit, we agree on any identifier. That's it. And we know. First of all, we must first
create a new project as you can see here. This is on your project window that I
and CREE are the size of this window. And let's see what we need from this
manages ok. He has a little launch. OKAY. We need to increase the size of the
police to 20 so you can well it's good. This is the configuration you can put your
configuration code here to run once. So, between these two hooks, we are going
but our configuration code for turns. This is the newspaper, so it will be it and you
have to put your main card here put on the beat command indefinitely. First, if Pfui
must identify any variable, we need to define this area here, we need a named
variable of data and give it a zero value. This is the initial value. You do not need to
put it so that you have control of the first value of this. First of all, if you are literate
without equal to zero and that you will have to get the available value, then more.
So, no, we have to take control of this variable, we give it a value that we know is
zero. So this change will happen from this base that is zero. Not in this area, you
must click with your mouse button here and start the senior communication
module. You only have to write a cereal point begins. Then, as you can see here,
the baud rate that is measured in bit per second how many bits per second will be
transmitted or received. It must be identical for both modules and we use 9600
baud flows for the serial data regime mission here. And the configuration, then we
must assign the number of tray 13 to be out. But since we communicate it, it will
take an output signal to activate or disable. Was right that men on board, which is
30 years old, then produce that. We initialize the flow rate of the 9600 baud
communication, then we attribute the number 13 tray to be as an output. Now, in
the empty loop, we must write a statement if it checks if there is a real
communication occurs or not. And so that we send only data when we receive
data. Thus, if okay, it is the main form where we need to condition more zero and
inside, inside these two buckets, we would like our code. OKAY. Ok, now I would of
course write that he is in the middle between these two taxis. First, we need to
read the incoming data and store the incoming value and data on your banking
data are equal to cereals that read. Now we need to bring the incoming data and
the value of the data into the Syria data on top so that we can make sure we will
see the cereal of light. Dr Brant by the variable data he is after you need to move a
line below. So, if we thought when I will not come from a line, as will see again.
Brant OK semi-colon inside that we must flaw on an abbreviation for the new line
and means in the new line. OK after thinking of the data we want to verify that
these data are equal to an ok. That's what it's equal to one. If this is equal to the
one we need to write as we mentioned in the application where we need to
activate the head, which means that I think that the value of one of the high logic of
about 15 is now so The value received is zero. Then we need to write a weak or
zero logic to report about 15 to 10 of this advance. Ok, that's it. This is our code.
Now we have to back up the game 7 slides or bend or bend you with your chords.
OK called. Just click this button to verify that our code is not at all of the syntaxes.
As you can see, combine skitch ok everything is fine from. As you can see, this is
not all it is done here, the combination of our code contains only 19 lines. OKAY.
And now I thought if you want to do that, we just have to click here. After assured
that we choose the right to come from here. After that, we do not know we need to
go to this device manager. And check the clipboard you can see here, which are
on I, I'm connected, we have to move the fight here. After that, you can simply be
connected by clicking the Block button here. But since he does not have an
Arduino, he will not make war. And the next lesson, I will connect to an Arduino on
the money and we will test this code in the city on the monitoring card. But before
doing this examine what we did here. At first, we have set a volleyball to store
received data. Then we defined the table for transmission. And this line. Then we
said digital flap 13 as an exit. After that, we send data only when we receive data.
You must check if there is one received person. If there is then the incoming data
and store it in this variable mix the value in the Value data and see the monitor on
your line to reflect on any new data verification if a data value is equal to 1. Now, if
the value is now. This is then less than if the value is zero and then layoff. This is
our code. It's really simple. You can change that with what you want, but all this
followed the same principle.
TESTING CODE
Arduino Tip for you or you will be bored and your computer or your
laptop OK to connect it. Let's go to the Device Manager. To see the
combo that will be assigned to us, we know. So, as you can see
here, there is no affected. Now, once we can Nick We Board as you
can see Arduino on the coming. If you double-click here as you can
see. We see these other bullets to things. 9600 Baud rate. Now we
have to go here and click on Chrome for all we know, then simply
continue to Click Check the file called again, and then click the
download button to download it. OK downloading download. Now the
code is downloaded from our Arduino on a ball to test it. Come on
Siri tools on the monitor.
Now, if we sent one as you can see or two or three or four. And the
thing we send here if we use our Android app, let's say and I think
we are here must come back. Now, to see the changes here and
when we enter, but it must show us this number. You talked about
asking us and a tool with that number we liked. So, if you have
written it, he will start with one. Now to see the changes. Let's add a
sentence before this one says that I am bobbing that your
impatience is ok. Now check our code and download it. Now, if you
have written a sentence answer with a sentence, the number you
find yourself like the same as any other number. As you can see is
that I think this version of this sentence, is somehow thinning the
variable it has done in this line. So, he has been integrated into us
for us. We showed the T. As you can see, it is essentially the way
cynical drugs work and this is tested for our code.
EARN WITH ARDUINO
How to make money with Arduino. Robotics is a daydreaming field
that creates armour in the future of the iron or even makes a more
reasonable project that you can use in everyday life through the spirit
of an inventor of robotics is a world full of promises and gives us the
power to remove problems with solutions This new might sound
complicated and we think that you have to learn for a long time
because we need significant finance to make it happen if you want to
realize the robot project to commercialize you need electronic tools
for hardware production equipment and therefore investors That only
a company that is capable of this is why we have the right to wonder
whether this dream can be accessed or if it's too big but when we
want to succeed we can't give up. I just want to make my robot
project, I will do the project every week. I have a butterfly in my
stomach today with any computer just on the Arduino board on
components such as sensors on your actuator can realize a
promising robot project and your internet blessings can make your
discovery known and start selling it on the crowdfunding platform
among the best Kickstarter and Indiegogo Known Kickstarter allows
you to make your project look in exchange for 5% some managed to
increase hundreds of thousands of dollars and other millions of
dollars, it's not so simple. The success rate is 36% and three-
quarters of those who fail to get less than 20%. At least we can say
is whether it's like it or not at all. After your Kickstarter campaign, you
will have funds to start production and this will allow you to make
yourself known because you are a small team and maybe still alone,
you don't need to get a lot of customers to make your business
worthy of your business you can see the campaign Successful and
simple concepts. The key is that he still responds to real needs.
Their testimony that has launched many major projects that fail
which why you need to know the main points that will make you
project success. This success is not for mysterious reasons. They
are just logical. (With content requesting your emotional visualization
and senses). Highlighting the benefits of your product, this is a very
important point. Present on social networks a few months if possible
before your launch. This is social proof that prepares the launch of
your Kickstarter campaign by taking emails from people who are
interested in which you get through social networks and/or your
website. And this is to warn them that your campaign will be
launched. Indeed Kickstarter highlights projects that have funds that
come in the early days. Contact Blogger, Influencer and Media in
your industry to help you market your product. And of course, have
the motivation to patience. To select the project you want to live in
course by knowing that you will not be appreciated until you finish
your campaign, maybe you don't know in this case there is a method
to find ideas or at least to identify whether a good idea.
THE END
High and low logic signals are used in an Arduino setup to control LEDs by determining whether they are on or off. A high signal (HIGH) typically causes an LED to illuminate, while a low signal (LOW) turns it off. These signals are digital states representing voltage levels, where "high" corresponds to a higher voltage (such as 5V) and "low" to zero or ground voltage . In Arduino code, the "digitalWrite" function can be used to set the state of a digital pin to HIGH or LOW, which in turn controls the LED connected to that pin . For example, in a simple digitalWrite implementation, setting a pin to HIGH will apply voltage, thereby lighting up the connected LED, while LOW will remove the voltage and turn off the LED . This mechanism is fundamental to Arduino's capability to interact with external devices through digital output .
Checking serial ports in Arduino environments is crucial for debugging code involving digital output because it helps verify that the code is communicating correctly with the hardware. The serial port allows the printed data to be transmitted through the serial monitor, helping detect errors or unexpected behavior . This is particularly important when digital pins are used, as using pins 0 and 1 for other functions can cause serial communication issues . Serial communication settings, such as initializing with a baud rate of 9600, are also essential for ensuring that data is correctly sent and received by the connected devices . The serial port thus acts as a vital tool for real-time monitoring and troubleshooting of digital outputs ."}
Servo motors and stepper motors both serve in applications requiring precise motion control but serve distinct roles. Servo motors, which can move to a specific angle quickly and accurately, are often employed in applications where position control over a limited range (typically up to 180 degrees) is critical, as they can be precisely positioned using feedback mechanisms such as a potentiometer or encoder . They are often used for tasks requiring high torque and a reliable holding capability at specific angles, like in robotics for joint control . Stepper motors, on the other hand, are used for precise incremental movement, being able to divide a full rotation into up to 200 steps for high precision . They are commonly used in applications such as 3D printers and CNC machines where fine control over long distance rotation is necessary . Stepper motors operate open-loop, sacrificing speed for accuracy and repeatability due to their simplicity . Despite both types delivering precision, servo motors excel where feedback and dynamic conditions are needed, while stepper motors are ideal for controlled, precise positioning tasks over long rotations .
The KY-034 7-color LED flash module functions by automatically cycling through different colors in a preset sequence due to the built-in programming. It connects to an Arduino via digital pins, using an onboard resistor to limit current. However, it has limitations in that its behavior cannot be altered by the user; the cycle timing and color sequence are fixed, and the only external control is turning the LED on or off via a digital output from a microcontroller .
A DC motor operates with continuous rotation driven by applying voltage, and the direction of rotation can be reversed by changing the polarity of the connections. DC motors are commonly used when continuous rotation and simple control circuits are needed, such as in fans or simple robotics . A stepper motor, however, moves in discrete steps and is driven by electrical pulses. This allows precise control of angular position, speed, and acceleration, making stepper motors suitable for applications requiring precise movement like CNC machines and 3D printers .
A 0-ohm resistor functions as a simple wire link in module designs, offering a convenient way to route traces over the PCB or connect different electronic sections without a break. It is often used to create a removable jumper link or to serve as a placeholder in the design, allowing engineers to easily modify the circuit during testing or later revisions without redesigning the PCB .
In Arduino programming, a for loop is used to repeatedly execute a block of code a specific number of times or under specific conditions. For example, a for loop can control an LED by turning it on and off in a sequence. It might set the pin mode to output, turn the LED on for a certain duration, and then off, repeating this until a condition is met or the specified number of cycles completes. The for loop allows precise control over the operation timing and is essential in implementing tasks that require repetitive actions in embedded systems .
The resistor in a photo interrupter module is used primarily to limit the current circulating within the module, thereby preventing it from being damaged by excessive current . Additionally, this resistor helps ensure the module operates safely and correctly by preventing current surges that could compromise the module's functionality . In the context of the photo interrupter, the resistor contributes to maintaining a stable current flow, ensuring reliable operation when the photo sensor detects or does not detect an object interrupting the light beam .
The mercury tilt switch module operates by using a small glass capsule filled with mercury and two contacts. When the module is tilted, the mercury makes contact with the two electrodes, completing the circuit and thus changing the state of the digital signal from the switch. Digital signals play a crucial role in this module's functioning by allowing the switch to communicate with microcontroller systems such as Arduino or Raspberry Pi. These signals are either high or low, depending on the mercury's position, enabling the detection of tilt changes . The digital signal from the module can be read through any digital port on a microcontroller to trigger actions like turning on an LED if the module detects a tilt . The module outputs a digital signal directly, which determines the state of a connected device, based on whether the circuit is closed by the mercury’s movement, reflecting its current status ."}
The photo resistor module outputs an analog signal, providing a continuous range of values proportional to the intensity of light received, which can be connected to an analog pin on a microcontroller . In contrast, the photo interrupter module gives a digital output, which switches between two states (high and low) when an object interrupts the infrared light path between its emitter and detector. The digital signal can be connected to a digital pin on a microcontroller .