Saturday, 7 March 2015

Algorithm to make Raspberry PI

1. Berapa pin gpio yang kamu butuhkan untuk menyalakan rangkaian?
2. Berapa pin gpio dari poin 1 diatas yang kamu jadikan mode input?
3. Berapa pin gpio dari poin 1 diatas yang akan kamu jadikan mode output?



1. Mengimport library atau mengimpor modul
2.


#!/usr/bin/python
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.cleanup()
GPIO.setwarnings(False)
GPIO.setup(17,GPIO.out)
GPIO.setup(27,GPIO.out)
print "Lights On"
GPIO.output(17, GPIO.HIGH)
GPIO.output(27, GPIO.HIGH)



Friday, 6 March 2015

algorithm to design a logo

1. Determine the text.
Contoh: kedai kopi yuli.

2. Choose the color of your text

3. Draw your text

3. Determine your main word
For instances:
grocery, bakery, goods delivery, cleaning service, etc.

4. Choose a symbol to present the main word

5. Draw your logo behind your text

4. Determine your word (adjective word):
For instances:
1. Forever; loop; continuous
2. Pure
3. Saint;
4. Happines
5. Courage
6. Strength
7. Fellow
8. Instant / flash
9. All over the world


5. Choose a symbol to perform your adjective word
For instances
1. An omega symbol is for forever or loop or continuous symbol.
2. A crystal for
#!usr/bin/python --> to show where the python interpreter resides.



Rasp PI very basic and usefull commands


1. You want to view a file?


1. You want to back up a file?
backup file is basically copy-ing a file.

Tuesday, 3 March 2015

Raspberry GPIO

Untuk menghubungkan projek Raspberry Pi kamu dengan dunia luar, kamu perlu belajar:
1. Pengenalan Python
2. GPIO
3. Cara mengimport
4. Komponen elektronika yang akan kamu pasang, contoh: LED, 7 segment display, Sensors: Windspeed sensor, heat sensor (built-in), etc.


Pin GPIO:
3
5
7
8
10
11
12
13
15
16
17
18
19
21
22
23
24
26

Pin Ground
6
9
14
20
25

Pin 5 Volt
2
4

Pin 3.3 Volt
1
17

Pin GPIO bisa berfungsi sebagai
1. Input

Tidak bisa sekedar menghubungkan pin 3 ---> switch ---> ground. Karena akan float.


2. Output

Pin 3 --> LED ---> Resistor ---> Ground / pin 6



GPIO layout



Steps:
In python script
1. Import GPIO module
2. Set the board mode to that of your preference
3. Set up the pins you want to use, and
4. Turn them on
Contoh:
import RPi.GPIO as GPIO

GPIO.setmode(GPIO.BCM)  # set board mode to Broadcom

GPIO.setup(17, GPIO.OUT)  # set up pin 17
GPIO.setup(18, GPIO.OUT)  # set up pin 18

GPIO.output(17, 1)  # turn on pin 17
GPIO.output(18, 1)  # turn on pin 18
1. Ballon Pi-Tay Popper
How to use Python code to control the Pi's GPIO pins to heat up a resistor to pop a ballon.

2. Minecraft-whac-a-block-game alias Making a game with minecraft


3. Drawing snowflakes


4. 

Monday, 2 March 2015

What is pass by value and pass by reference? it is a method to pass a value to a function that is by value or by reference.

Pass by value :
1. copied
2. menghabiskan memori.


Pass by refernce:
1. not copied
2. tidak menghabiskan memori
3. It just referenced by memory address.

Langkah membentuk/menciptakan fungsi:
1. Tentukan nama fungsi.
2. Tentukan parameter/argumen apa saja yang akan diambil fungsi; di dalam tanda kurung.
3. Tentukan proses apa saja yang akan dilakukan fungsi.
4. Tentukan apa yang dikembalikan atau di-return fungsi ini.

Contoh:
#include <stdio.h>
#include <conio.h>

void display(int, int);

int main()
{
int x, y;
x = 10;
y = 20;
printf("x is %d and y is %d\n",x,y);

display(x,y);

getch();
return 0;
}

void display(int a, int b)
{
printf("a is %d and b is %d\n",a,b);
}


Langkah membentuk/menciptakan fungsi:
1. Tentukan nama fungsi.
2. Tentukan parameter/argumen apa saja yang akan diambil fungsi; di dalam tanda kurung.
3. Tentukan proses apa saja yang akan dilakukan fungsi.
4. Tentukan apa yang dikembalikan atau di-return fungsi ini.

1. Tentukan nama fungsi:
display

2. Tentukan parameter/argumen apa saja yang akan diambil fungsi; di dalam tanda kurung.
int a dan int b.

3. Tentukan proses apa saja yang akan dilakukan fungsi:
printf("x is %d and y is %d\n",x,y);

4. Tentukan apa yang dikembalikan atau di-return fungsi ini:
Tidak ada return.