Understanding Computer Systems
Understanding Computer Systems
Computer – is an electronic machine that follows a set of instructions in order that it may be able to accept and gather
data and transform this into information
– is a device that accepts information (in the form of digitalized data) and manipulates it for some result
based on a program or sequence of instructions on how the data is to be processed.
1. Education - Computers are extensively used, as a tool and as an aid, for imparting education.
3. Sports - A computer can be used to watch a game, view the scores, improve the game, play games (like chess, etc.)
and create games.
5. Medicine - Medical researchers and practitioners use computers to access information about the advances in
medical research globally.
6. Science and Engineering - Scientists and engineers use computers for performing complex scientific calculations, for
designing and making drawings (CAD/CAM applications) and also for simulating and testing the designs.
7. Government - The government uses computers to manage its own operations and also for e-governance in
providing information to the users and are used for the filing of income tax return, paying taxes, for the access of land
record details, etc.
1. High Speed
- It can perform millions of calculations in a few seconds as compared to man who will spend many
months for doing the same task.
2. Accuracy
- Computers are very accurate and the calculations are 100% error free.
- Computers perform all jobs with 100% accuracy provided that correct input has been given.
3. Storage Capability
- It can store large amount of data.
- It can store any type of data such as images, videos, text, audio and many others.
4. Diligence
5. Versatility
- A computer is very flexible and after its operation to the program stored in it.
6. Reliability
7. Automation
- Computer is an automatic machine and can perform the given task automatically.
- Once a program is given to computer i.e. stored in computer memory, the program and instruction can control the
program execution without human interaction.
- As data in electronic files can be retrieved as and when required, the problem of maintenance of large number of
paper files gets reduced.
9. Reduction in Cost
- Though the initial investment for installing a computer is high but it substantially reduces the cost of each of its
transaction.
1. No I.Q
2. Dependency
3. No Feeling
- It cannot make judgment based on feeling, taste, experience, and knowledge unlike a human being.
Classification of Computer “invented three age group of devices to assist him in calculating and processing data.”
1. Manual Mechanical – is a tool or device with simple mechanism powered by the hand. And these are:
- Abacus
- Napier’s Bones
- Pascal’s Calculator
- Leibniz’s Calculator
2. Electromechanical
– an electromechanical device is usually powered by an electric motor and uses switches and relays. And these are:
- Jacquard’s Loom
3. Electronic Devices – are devices which use electrical switches and circuitry.
- Atanasoff-Berry Computer– used 45 vacuum tubes for internal logic and capacitors for storage.
- Electronic Numerical Integrator and Calculator (ENIAC) – was the first all-electronic computer.
- Electronic Discrete Variable Automatic Computer (EDVAC) – used the stored' program concept in its design.
- Electronic Delay Storage Automatic Calculator (EDSAC) – the first full-size stored-program computer
Generations of Computer
Types of Computer
a. Memory Unit – are registers that can store instructions, data and intermediate results. This unit supplies
information to the other units of the computer when needed. Functions of memory unit are:
• it stores all the immediate data and the instructions required for processing.
b. Control Unit – controls the operations of all parts of computer but does not carry out any actual data processing
operations
• it is responsible for controlling the transfer of data and instructions among other units of a computer.
• it obtains the instructions from the memory, interprets them, and directs the operation of the computer.
• it communicates with Input/output devices for transfer of data or results from storage. c. ALU (Arithmetic Logic
Unit) – consists of two subsections namely:
• Arithmetic section – performs arithmetic operations like addition, subtraction, multiplication and division. All
complex operations are done by making repetitive use of above operations
• Logic Section – performs logic operations such as comparing, selecting, matching and merging of data
Types of Memory
1. Cache Memory – is a very high speed memory which can speed up CPU.
- It is located inside the CPU. - It acts as a buffer of CPU to/from main memory.
- It is used to hold those parts of data and program which are most frequently used for operations.
2. Primary Memory (Main Memory) – holds only those data and instructions on which computer is currently working.
- It has limited capacity and data is lost when power is switched off. - It is generally made up of semiconductor device
and found outside the CPU. - It is not as fast as registers found inside the CPU. - It is divided into two subcategories
RAM and ROM.
- It is used for storing data/Information permanently. CPU directly does not access these memories instead they are
accessed via input-output routines. Contents of secondary memories are first transferred to main memory, and then
CPU can access it. For example: disk, CD-ROM, DVD etc.
Units of Information
Memory/Storage Capacity
1. Hardware – represents the physical and tangible components of a computer i.e. the components that can be seen
and touched.
Hardware are following: • Input devices – keyboard, mouse etc. • Output devices – printer, monitor etc. • Secondary
storage devices – hard disk drive, solid state drives and other removable storage such flash drives, CDs and DVDs. •
System Unit – inside of it are CPU or processor, motherboard, RAM etc.
2. Software – is a set of programs, which tells the computer what to do and how to do. A program is a sequence of
instructions written to perform an operation.
a. System Software – is a set of one or more programs, designed to control the operation and extend the processing
capability of a computer system. In general, it performs one or more of the following functions:
- Monitors the effective use of various hardware resources, such as CPU, memory, peripherals, etc.
- Communicates with and controls the operation of peripheral devices, such as printer, disk, tape, etc. Some of the
most commonly known types of system software are:
- Operating Systems: Every computer has an operating system software, which takes care of the effective and
efficient utilization of all the hardware and software components of the computer system.
- Programming Language Translators – are system software, which transform the instructions prepared by
programmers in a programming language, into a form, which can be interpreted and executed.
- Communication Software: In a network environment, communications software enables transfer of data and
programs from one computer to another.
- Utility Programs – are set of programs, which help users in system maintenance tasks, and in performing tasks of
routine nature. Some of the task commonly performed by utility programs include formatting of hard disk or floppy
disks, taking backup of files stored on hard disk, sorting of the records stored in a file, etc.
b. Application Software – is designed to satisfy a particular need of a particular environment. Some of the most
commonly known application software’s are:
- Word-Processing Software – enables us to make use of a computer system for creating, editing, and viewing,
formatting, sorting, retrieving and printing documents.
- Spreadsheet Software – is a numeric data analysis tool, which allows us to create a kind of computer ledger.
- Database Software – is a set of one or more programs, which enable us to create a database, maintain it, organize
its data in desired fashion, and to selectively retrieve useful information from it. A database is a collection of related
data stored and treated as a unit for information retrieval purposes.
- Graphics Software – enables us to use a computer system for creating, editing, viewing, sorting, retrieving and
printing designs, drawings, pictures, graphs, and anything else that can be drawn in the traditional manner.
- Education Software – allows a computer system to be used as teaching and learning tool.
- Entertainment Software – allows a computer system to be used as an entertainment tool. A good example of such
an application is computer video games.
Application software may consist of a single program, such as a Microsoft's notepad for writing and editing simple
text. It may also consist of a collection of programs, often called a software package, which work together to
accomplish a task, such as a spreadsheet package.
• Hardware and software are mutually dependent on each other. Both of them must work together to make a
computer produce a useful output.
• Software cannot be utilized without supporting hardware.
• Hardware without set of programs to operate upon cannot be utilized and is useless.
• To get a particular job done on the computer, relevant software should be loaded into the hardware
• A software acts as an interface between the user and the hardware. If hardware is the 'heart' of a computer system,
then software is its 'soul'. Both are complimentary to each other.
1. ALU 2. BIOS 3. CAD 4. CAM 5. CPU 6. DVD 7. ENIAC 8. GB 9. GUI 10. I/O 11. PC 12. RAM 13. SSD 14. ULSI 15.
USB
3. Algorithms should be most effective among many different ways to solve a problem.
4. An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can
be used in different programming languages.
Examples:
1. Start
5. Display sum
6. Stop
1. Start
7. Stop
– use various symbols to denote different types of actions or steps and arrows to indicate the flow and sequence of
these steps.
Flowchart Rules
PSEUDOCODES
Pseudocode – is a simplified, informal way of describing a program's logic or algorithm. – uses plain language and a
structure that resembles programming languages but omits specific syntax rules. – is intended to be easily
understood by humans, serving as a bridge between the algorithm design and actual coding.
Characteristics of Pseudocode:
Uses of Pseudocode:
Example Pseudocode:
BEGIN
INPUT number
PRINT "positive"
ELSE
PRINT "non-positive"
ENDIF
END
nning: They aid in the planning phase of software development, ensuring that logic is sound before coding
begins.
development process.
Computer programming – or programming is the process of designing and building an executable computer program
to accomplish a specific computing result or to perform a specific task.
– is the process of creating a set of instructions that tell a computer how to perform a task.
– can be done using a variety of computer programming languages, such as JavaScript, Python, and C++.
Programming Language – is a formal language comprising a set of instructions that produce various kinds of output.
1. Low level language – is the most understandable language used by computer to perform its operations. It can be
further categorized into:
a) Machine language (1GL) – consists of strings of binary numbers (i.e., 0s and 1s) and it is the only one language, the
processor directly understands. Machine language has an advantages of very fast execution speed and efficient use of
primary memory. Advantages:
- It is directly understood by the processor so has faster execution time since the programs written in this language
need not to be translated.
Disadvantages:
- It is very difficult to program using 1GL since all the instructions are to be represented by 0s and 1s. - Use of this
language makes programming time consuming.
b) Assembly language (2GL) – is also known as low-level language because to design a program programmer requires
detailed knowledge of hardware specification. This language uses mnemonics code (symbolic operation code like
‘ADD’ for addition) in place of 0s and 1s. The program is converted into machine code by assembler. The resulting
program is referred to as an object code.
Advantages:
- It is makes programming easier than 1GL since it uses mnemonics code for programming. For example: ADD for
addition, SUB for subtraction, DIV for division, etc.
- Programs written in this language is not directly understandable by computer so translators should be used.
- It is hardware dependent language so programmers are forced to think in terms of computer’s architecture rather
than to the problem being solved.
- Being machine dependent language, programs written in this language are very less or not portable.
2. High level language – uses instructions closely resembles to human language or English like words. The high-level
language is easier to learn. It requires less time to write and is easier to maintain the errors. The high-level language is
converted into machine language by one of the two different languages translator programs; interpreter or compiler.
High level language can be further categorized as:
a) Procedural-Oriented language (3GL) – Procedural Programming is a methodology for modeling the problem being
solved, by determining the steps and the order of those steps that must be followed in order to reach a desired
outcome or specific program state. These languages are designed to express the logic and the procedure of a problem
to be solved. It includes languages such as Pascal, COBOL, C, FORTAN, etc.
Advantages:
- Because of their flexibility, procedural languages are able to solve a variety of problems.
- Programmer does not need to think in term of computer architecture which makes them focused on the problem. -
Programs written in this language are portable. Disadvantages:
b) Problem-Oriented language (4GL) – allows the users to specify what the output should be, without describing all
the details of how the data should be manipulated to produce the result. This is one step ahead from 3GL. These are
result oriented and include database query language. Examples are Visual Basic, C#, PHP, etc.
Advantages:
- Programmer need not to think about the procedure of the program. So, programming is much easier.
Disadvantages:
c) Natural language (5GL) – are still in developing stage where we could write statements that would look like normal
sentences. Advantages:
- Easy to program.
- Since, the program uses normal sentences, they are easy to understand.
- The programs designed using 5GL will have artificial intelligence (AI).
- It is slower than previous generation language as it should be completely translated into binary code which is a
tedious task.
- Highly advanced and expensive electronic devices are required to run programs developed in 5GL. Therefore, it is an
expensive approach.
Types of Language Processors 1. Compiler – is a language processor that reads the complete source program written
in high level language as a whole in one go and translates it into an equivalent program in machine language.
– the source code is translated to object code successfully if it is free of errors. The compiler specifies the errors at the
end of compilation with line numbers when there are any errors in the source code. The errors must be removed
before the compiler can successfully recompile the source code again.
2. Assembler – is used to translate the program written in Assembly language into machine code. The source program
is an input of assembler that contains assembly language instructions. The output generated by assembler is the
object code or machine code understandable by the computer.
3. Interpreter – translates a single statement of source program into machine code and executes it immediately
before moving on to the next line. If there is an error in the statement, the interpreter terminates its translating
process at that statement and displays an error message. The interpreter moves on to the next line for execution only
after removal of the error. An Interpreter directly executes instructions written in a programming or scripting
language without previously converting them to an object code or machine code.
– is a high-level procedural language that become one of the most widely-used programming languages.
– is still a relatively complex language and elements can be seen in C#, C++, Java, Python, and more.
– is mainly used for creating system applications, games, graphics, and apps that use lots of calculations.
– is a popular object-oriented programming language and can run on just about any device with the Java platform.
– some of the main uses include for business software, web applications, and mobile apps.
– has many applications more importantly in general use, such as for web applications, artificial intelligence (AI) and
– is a powerful general-purpose and flexible programming language.
– supports different ways of programming like procedural, object-oriented, functional, and so on.
– (pronounced "C sharp") is a simple, modern, object-oriented, and type-safe programming language.
– roots in the C family of languages makes C# immediately familiar to C, C++, Java, and JavaScript programmers.
– or VB, is an object-oriented and event-driven programming language developed by Microsoft.
– uses environment from Windows that provides a graphical user interface (GUI) which allows programmers to
modify code by simply dragging and dropping objects and defining their behavior and appearance.
– is a high-level, object-oriented programming language which uses a Javalike syntax, which is where the
name comes from.
– is a language used to write code that runs in web browsers for making web pages interactive and responsive.
– is often used alongside HTML and CSS to add things like animations, video players, and even browser-based games.
– is another easy-to-learn coding language that is both free and open source and mainly used for coding on
websites.
– (sometimes called Sequel) is a domain-specific language designed for managing data held in databases.
– is mainly used to communicate with databases, data analysis and big data mining.
– or Apache Groovy, is an object oriented and Java syntax compatible programming language built for the
Java platform.
– can be used as a scripting language for the Java platform and almost like a super version of Java which offers Java's
enterprise capabilities.
C LANGUAGE PROGRAMMING
– is the most widely used computer language and keeps fluctuating at number one scale of popularity along with Java
programming language, which is also equally popular and most widely used among modern software programmers.
Advantages of C programming
-level activities
Facts About C
n C.
-of-the-art software have been implemented using C.
Applications of C Programming
1. Documentation Section – is a section in which you can give comments to make the program more interactive. The
compiler won’t compile this and hence this portion would not be displayed on the output screen.
2. Preprocessor directives Section – is a section which involves the use of header files that are to included necessarily
in the program.
3. Definition section – is a section which involves the variable definition and declaration in C.
4. Global declaration Section – is a section used to define the global variables to be used in the programs, that means
you can use these variables throughout the program.
5. Function prototype declaration section – is a section which gives the information about a function that includes,
the data type or the return type, the parameters passed or the arguments.
6. Main function – is the major section from where the execution of the program begins. The main section involves
the declaration and executable section.
7. User-defined function section – When you want to define your function that fulfills a particular requirement, you
can define them in this section.
In 2005, building upon the work of Hernando Barragán (creator of Wiring), Massimo Banzi and David Cuartielles
created Arduino at the Interaction Design Institute Ivrea in Ivrea, Italy. David Mellis developed the Arduino software,
which was based on Wiring. Before long, Gianluca Martino and Tom Igoe joined the project, and the five are known as
the original founders of Arduino.
They selected the AVR family of 8-bit microcontroller (MCU or µC) devices from Atmel and designed a self-contained
circuit board with easy-to-use connections, wrote bootloader firmware for the microcontroller, and packaged it all
into a simple integrated development environment (IDE) that used programs called “sketches.” The result was the
Arduino.
Arduino is an open-source electronics platform based on easy-to-use hardware and software. It provides a
straightforward way to create interactive projects using microcontrollers that can be programmed to interact with
sensors, actuators, and other electronic components. While Arduino programs are written in a language that is
essentially C/C++ with some simplified syntax. The Arduino IDE includes built-in libraries to handle common tasks,
which simplifies coding.
Arduino Uno – is an open-source microcontroller board based on the Microchip ATmega328P microcontroller
anddeveloped by Arduino.cc.
– has board equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various
expansion boards (shields) and other circuits. The board has 14 digital I/O pins (six capable of PWM output), 6 analog
I/O pins, and is programmable with the Arduino IDE (Integrated Development Environment), via a type B USB cable.
– can be powered by the USB cable or by an external 9-volt battery, though it accepts voltages between 7 and 20
volts. It is similar to the Arduino Nano and Leonardo.
– has word "uno" means "one" in Italian and was chosen to mark the initial release of Arduino Software.
– is the first in a series of USB-based Arduino boards. The ATmega328 on the board comes preprogrammed with a
bootloader that allows uploading new code to it without the use of an external hardware programmer.
The Arduino Uno is the most “standard” Arduino board currently on the market, and is probably the best choice for
beginners just getting started with the platform. The board is compatible with more shields (add-on boards) than
other models. Some boards look a bit different from the one given below, but most Arduinos have majority of these
components in common
1 – Power USB. It can be powered by using the USB cable from your computer. All you need to do is connect the USB
cable to the USB connection.
2 – Power (Barrel Jack). It can be powered directly from the AC mains power supply by connecting it to the Barrel
Jack.
3 – Voltage Regulator. Its function is to control the voltage given to the Arduino board and stabilize the DC voltages
used by the processor and other elements.
4 – Crystal Oscillator. It helps Arduino in dealing with time issues. How does Arduino calculate time? The answer is, by
using the crystal oscillator. The number printed on top of the Arduino crystal is 16.000H9H. It tells that the frequency
is 16,000,000 Hertz or 16-MHz.
5 – Arduino Reset. It is used to reset the Arduino board, i.e., start the program from the beginning. Resetting UNO
board comes in two ways: a.) First, by using the reset button on the board and b.) second, by connecting an external
reset button to the Arduino pin labelled RESET.
• (8) GND (Ground): There are several GND pins on the Arduino, any of which can be used to ground your circuit.
• (9) Vin: This pin also can be used to power the Arduino board from an external power source, like AC mains power
supply.
10 – Analog pins. The Arduino UNO board has five analog input pins A0 through A5. These pins can read the signal
from an analog sensor like the humidity sensor or temperature sensor and convert it into a digital value that can be
read by the microprocessor.
11 – Main microcontroller. Each Arduino board has its own microcontroller. It is assumed as the brain of your board.
The main IC (integrated circuit) on the Arduino is slightly different from board to board. The microcontrollers are
usually of the ATMEL Company. You must know what IC your board has before loading up a new program from the
Arduino IDE.
12 – ICSP pin. Mostly, ICSP is an AVR, a tiny programming header for the Arduino. It is often referred to as an SPI
(Serial Peripheral Interface), which could be considered as an "expansion" of the output. Actually, you are slaving the
output device to the master of the SPI bus.
13 – Power LED indicator. This LED should light up when you plug your Arduino into a power source to indicate that
your board is powered up correctly. If this light does not turn on, then there is something wrong with the connection.
14 – TX and RX LEDs. The TX led flashes with different speed while sending the serial data. The speed of flashing
depends on the baud rate used by the board. RX flashes during the receiving process.
15 – Digital I/O. The Arduino UNO board has 14 digital I/O pins (of which 6 provide PWM (Pulse Width Modulation)
output. These pins can be configured to work as input digital pins to read logic values (0 or 1) or as digital output pins
to drive different modules like LEDs, relays, etc. The pins labeled “~” can be used to generate PWM.
16 – AREF. AREF stands for Analog Reference. It is sometimes, used to set an external reference voltage (between 0
and 5 Volts) as the upper limit for the analog input pins.
TYPES OF ARDUINO
Since then, the Arduino has grown in several different directions, with some versions getting smaller than the original,
and some getting larger. The Arduino family of boards use processors developed by the Atmel Corporation of San
Jose, California. Most of the Arduino designs utilize the 8-bit AVR series of microcontrollers.
Arduino Integrated Development Environment (IDE)
– is a special software running on computer system that allows programmers to write sketches (synonym for program
in Arduino language) for different Arduino boards.
– uses programming language that is based on a very simple hardware programming language called processing,
which is similar to the C language.
– contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common
functions, and a series of menus
Sketches – are set of instructions for Arduino. – are saved with the file extension .ino
Bootloader – also spelled as boot loader or called boot manager and bootstrap loader, is a computer program that is
responsible for booting a device and stored on non-volatile memory.
– is a piece of code that is stored in a reserved space of the memory of Arduino board. Basically, this code initiates
the sketch as soon as the board is powered on and also allows new sketches to be uploaded from the program device.
Libraries – provide extra functionality for use in sketches, e.g. working with hardware or manipulating data.
ArduinoDroid – is a free app that will let you edit, compile and upload sketches to your Arduino board directly from
an Android phone or tablet. It has the following features:
All Arduino sketches have a standardized code structure. This keeps the code easy to read and modify later. The
compiler doesn’t care what order you put these things in, but by convention, people tend to structure their Arduino
code in the following order:
2.) Libraries: You specify which libraries you want to use in your code. All libraries must be in your Arduino libraries
folder or your compiler will complain.
3.) Variable declarations: You specify what variables you are going to use in your code and what their initial values
are. You learn more about the different kinds of variables you can use, as you build the projects in this book.
4.) Setup: You define how your Arduino will be used and set up any pins and communications you will be using. This
section is indicated by the instruction setup(){ and it is always concluded with a closing curly bracket:}. Code in your
setup is executed first and one time only.
5.) Loop: You place the main instructions for your code. The loop is executed after setup and for as long as your
Arduino is powered up. Any code between the curly brackets {} is processed sequentially and then repeated forever.
The loop is processed as fast as the Arduino can go —around 16 million calculations per second.
6.) User-defined functions: You create your own reusable functions that describe how to do something useful. If you
need to repeat an operation or calculation many times as your
Arduino is running, I recommend that you create a function to do this. This modular way of coding makes it easy to
make a change to how your code works.
Libraries – are used to expand the functionality of Arduino programming just like most programming platforms. It
provides extra functionality for use in sketches, e.g. working with hardware or manipulating data.
Standard Libraries
– for communicating with applications on the computer using a standard ser – for
connecting to a GSM/GRPS network with the GSM shield.
– – – for
– for communicating with devices using the Serial Peripheral Interface (SPI) Bus
– for drawing text, images, and shapes on the Arduino TFT screen
Comments – are lines in the program that are used to inform yourself or others about the way the program works. Its'
only purpose is to help you understand (or remember), or to inform others about how your program works.
– are ignored by the compiler, and not exported to the processor, so it doesn’t take up any space in the
microcontroller’s flash memory. – has two kinds:
a. Block comment or a multi-line comment is marked by the symbol /* and the symbol */ marks its end.
b. Single line comment begins with // (two adjacent slashes) and the comment ends automatically at the end of a line.
Serial – is used for communication between the Arduino board and a computer or other devices. All Arduino boards
have at least one serial port (also known as a UART or USART), and some have several.
Serial.begin( ) – opens up the USB port for serial communication and also sets the baud rate. Typical baud rate for
serial communication with computer is 9600bps.
Serial.print( ) and Serial.println( ) – prints the value passed into the brackets on to the Serial Monitor.
– is called when the invisible cursor must stay on the same line so text printed in the println( )
statement that follows will be printed on the same line as well.
– is used when text must be printed and then the invisible cursor moved to the next line so that
the next print( ) statement will print text on a new line.
SERIAL INSTRUCTIONS
The Serial Monitor is a separate pop-up window that acts as a separate terminal that communicates by receiving and
sending Serial Data. Serial Data is sent over a single wire (but usually travels over USB in our case) and consists of a
series of 1's and 0's sent over the wire. Data can be sent in both directions.
Serial – is used for communication between the Arduino board and a computer or other devices. All Arduino boards
have at least one serial port (also known as a UART or USART), and some have several.
1. Serial.begin(baud rate)
• Initializes serial communication at the specified baud rate (e.g., 9600, 115200).
• Common baud rates include 9600, 14400, 19200, 38400, 57600, and 115200. Both the Arduino and the connected
device must use the same baud rate to communicate properly. 2. Serial.print(data):
• This function sends data without adding a newline character at the end. If multiple Serial.print statements are used
consecutively, their outputs will be on the same line. 3. Serial.println(data):
• Each Serial.println call will print data on a new line in the Serial Monitor. 4. Serial.read():
• Returns the first byte of incoming data available (or -1 if no data is available). 5. Serial.available():
• Returns the number of bytes available to read from the serial buffer.
• Useful for checking if there is data to read before attempting to read it. 6. Serial.readStringUntil(char):
• Reads characters from the serial buffer until a specified delimiter character is found.
• Useful for reading entire strings of data terminated by a specific character (e.g., newline). 7. Serial.end()
• Used to terminate the serial communication between the Arduino and the connected device (e.g., a computer or
another microcontroller).
• It shuts down the serial communication, releasing the serial port for other uses or freeing up resources on the
microcontroller.
How It Works:
1. setup() Function:
• The Serial.begin(9600); function initializes serial communication at a baud rate of 9600 bits per second. This is a
standard speed for serial communication between Arduino and the computer.
2. loop() Function:
• Inside the loop() function, the Serial.println("Hello, Arduino!"); command sends the text "Hello, Arduino!" to the
Serial Monitor. The println function ensures that each message appears on a new line. • The delay(1000); command
pauses the program for 1000 milliseconds (1 second) before the loop repeats, so the message is displayed once every
second.
print() – prints data to the serial port as human-readable ASCII text. This command can take many forms. Numbers
are printed using an ASCII character for each digit. Floats are similarly printed as ASCII digits, defaulting to two
decimal places. Bytes are sent as a single character. Characters and strings are sent as is. For example:
An optional second parameter specifies the base (format) to use; permitted values are BIN(binary or base 2),
OCT(octal or base 8), DEC(decimal or base 10), HEX(hexadecimal or base 16). For floating point numbers, this
parameter specifies the number of decimal places to use. For example-