Professional Documents
Culture Documents
Flowchart &
Pseudocode
Flowchart
Terminator
Process Data I/O
Arrow
Y N Subroutine
Connector
Decision
1
9/17/2020
Flowchart
Simple sequence
Kontrol dan iterasi:
If-then-else
If-then
Case
While-do loop
Repeat-until
For
2
9/17/2020
Simple sequence
Pseudocode:
Statement(s) 1
Statement(s) 1 Statement(s) 2
Example:
Get data sample
Add 7
Store in memory location
Statement(s) 2
Flowchart gambar, singkat
Pseudocode = a brief descriptions of the flow
of the code
Yes Condition No
?
Statement(s) 1 Statement(s) 2
3
9/17/2020
If-then
Pseudocode:
If condition then
Condition Statement(s)
? Example:
If hungry then
Yes get food
Statement(s) No
Yes Monday No
?
...
Read Yes Sunday
magazines
?
Read
newspaper
4
9/17/2020
Case
Pseudocode:
Case expression of
1: Statement(s) 1
2: Statement(s) 2
...
N: Statement(s) N
Example:
Case day of
Monday:
Read books
Tuesday:
Read magazines
Wednesday:
Read tabloids
…
Sunday:
Read newspaper
Sistem uP - KDPBA Antonius Wibowo 10
5
9/17/2020
While-do loop
Pseudocode:
While condition do
Statement(s)
Condition
? Example:
While money lasts
Yes No Eat supper out
Go to movie
Statement(s) Take taxi home
Repeat-until
Pseudocode:
Repeat
Statement(s)
Statement(s) No
Until condition
Example:
Repeat
Get data sample
Condition Add 7
? Store result in memory
Wait 1 hour
Yes Until 24 samples taken
6
9/17/2020
Example:
for (inisialisasi; kondisi; increment)
{
Tugas;
}
#include<avr/io.h>
I/O Programming
START
unsigned char i;
unsigned int k; INISIALISASI PORT
void delay_ms (); & ENABLE PULL-UP
7
9/17/2020
8
9/17/2020
7-segment