Lecture (01)
Introduction to Computer
System
NU : Spring 2025, CSCI205 - Introduction to Computer
1 System
A Computer system is a
What is computer System? programmable,
digital device
Memory RAM
CPU
Input output
Processing unit
i7
peripherals peripherals
HD
Storage
Flash
Keyboard Monitor
Mouse Speaker
mic printer
2 NU : Spring 2025, CSCI205 - Introduction to Computer System
Python IDE
example 01 py
Program Editor
Interactive Python Shell
C IDE
Example 01 C
4 NU : Spring 2025, CSCI205 - Introduction to Computer System
How to use code block to build C console
programs
Step 01
5 NU : Spring 2025, CSCI205 - Introduction to Computer System
Step 02
6 NU : Spring 2025, CSCI205 - Introduction to Computer System
Step 03
7 NU : Spring 2025, CSCI205 - Introduction to Computer System
Step 04
8 NU : Spring 2025, CSCI205 - Introduction to Computer System
Step 05
9 NU : Spring 2025, CSCI205 - Introduction to Computer System
Step 06
10 NU : Spring 2025, CSCI205 - Introduction to Computer System
“Hello World”
• Everyone writes this program first
#include <stdio.h> print("Hello World.")
int main ( )
{
printf ("Hello,
World.");
return 0;
}
11 NU : Spring 2025, CSCI205 - Introduction to Computer System
Python
12 NU : Spring 2025, CSCI205 - Introduction to Computer System
•
13 NU : Spring 2025, CSCI205 - Introduction to Computer System
Mobile as a computer system
•
14 NU : Spring 2025, CSCI205 - Introduction to Computer System
A Embedded system is a
So what is the Embedded system? compact programmable,
digital device
Memory RAM
Input output
328
MC
Processing unit
peripherals peripherals
EEPRO
Storage
M
Pins (Analog/Digital) Pins (Analog/Digital)
Serial port Serial port
15 NU : Spring 2025, CSCI205 - Introduction to Computer System
A Computer for the Physical World
• The friendly blue board is the Arduino.
• In some ways you could think of Arduino as the child of
traditional desktop and laptop computers.
• At its roots, the Arduino is essentially a small portable
computer.
• It is capable of taking inputs (such as the push of a button or a
reading from a light sensor) and interpreting that information
to control various outputs (like a blinking LED light or an
electric motor).
• That's where the term "physical computing" is born - an
Arduino is capable of taking the world of electronics and
relating it to the physical world in a real and tangible way.
16 NU : Spring 2025, CSCI205 - Introduction to Computer System
• // Arduino UNO R3
• The Arduino Uno is one of several development
boards based on the ATmega328.
• We like it mainly because of its extensive support
network and its versatility.
• It has 14 digital input/output pins (6 of which can
be PWM outputs), 6 analog inputs, a 16 MHz
crystal oscillator, a USB connection, a power jack,
an ICSP header, and a reset button.
17 NU : Spring 2025, CSCI205 - Introduction to Computer System
Arduino. Board Breakout
• 14 Digital IO pins (pins 0–13)
These can be inputs or outputs,
which is specified by the sketch
you create in the IDE.
• 6 Analogue In pins (pins 0–5)
• These dedicated analogue input
pins take analogue values (i.e.,
voltage readings from a sensor)
and convert them into a number
between 0 and 1023.
18 NU : Spring 2025, CSCI205 - Introduction to Computer System
• 6 Analogue Out pins (pins 3, 5, 6,
9, 10, and 11) These are actually
six of the digital pins that can be
reprogrammed for analogue
output using the sketch you
create in the IDE.
• The board can be powered from
your computer’s USB port, most
USB chargers, or an AC adapter (9
volts recommended)
19 NU : Spring 2025, CSCI205 - Introduction to Computer System
Programming commands and functions
• When you open Arduino IDE, you will find two min function
• 1. setup() is where you put all the code that you want to execute once at the
beginning of your program
• 2. loop() contains the core of your program, which is executed over and over again.
• This is done because Arduino is not like your regular computer—it cannot run
multiple programs at the same time and programs can’t quit.
• When you power up the board, the code runs; when you want to stop, you just turn
it off.
20 NU : Spring 2025, CSCI205 - Introduction to Computer System
• To control a pin, you may use it’s number(0-13),
• or you may define a int variable assigning the pin number to that integer, then use
variable to control pin
int led1 = 13;
21 NU : Spring 2025, CSCI205 - Introduction to Computer System
• To configure pin for output mode use the “pinMode()” command inside “setup()”
function to run thses configuration commands once while turning Arduino on
void setup()
{
pinMode(led1, OUTPUT);
void setup()
{
pinMode(13, OUTPUT);
22 NU : Spring 2025, CSCI205 - Introduction to Computer System
• to assign cetiain value to a pin, use “digitalWrite()” function
• As each pin presnts a bit, we will use binary system “1 HIGH” and “0 LOW”
void loop() void loop()
{ {
digitalWrite(led1, LOW); digitalWrite(13, LOW);
delay(250); delay(250);
• As Arduino is so fast (clock speed is 16 MHZ) you need to freeze it for a while to
allow user to notice changes and interact with it correctly. We use delay() function,
the freeze period wrote as argument in milli seconds
23 NU : Spring 2025, CSCI205 - Introduction to Computer System
Arduino Hello World Example 01
• Blink
• In most programming languages, the first program you write prints "hello world" to
the screen.
• Since an Arduino board doesn't have a screen, we blink an LED instead
• The boards are designed to make it easy to blink an LED using digital pin 13
• Some (versions) have the LED built-in to the board. On most others, there is a 1 KB
resistor on the pin, allowing you to connect an LED directly.
• (To connect an LED to another digital pin, you should use an external resistor.)
24 NU : Spring 2025, CSCI205 - Introduction to Computer System
25 NU : Spring 2025, CSCI205 - Introduction to Computer System
• LEDs have polarity, which means they will only light up if you orient the legs
properly.
• The long leg is typically positive, and should connect to pin 13.
• The short leg connects to GND; the bulb of the LED will also typically have a flat
edge on this side.
26 NU : Spring 2025, CSCI205 - Introduction to Computer System
Example 01 – LedFlaser
void setup()
{
pinMode(13, OUTPUT); // sets the digital pin as output
}
void loop()
{
digitalWrite(13, HIGH); // sets the LED on
delay(100); // waits for a 100 mille second
digitalWrite(13, LOW); // sets the LED off
delay(100); // waits for a 100 mille second
}
27 NU : Spring 2025, CSCI205 - Introduction to Computer System
Thanks,..
See you next week isA,..
28 NU : Spring 2025, CSCI205 - Introduction to Computer System