Autumn

When the leaves turn brown, the scent of the air is the best, you must be in autumn...

Winter

Suddenly tiny ice flakes fell down and all of places turn into romantic sites

Light Pageant

One of most beautiful site I visited in Japan

Line Follower Robot

Simple but very precious for me. Roughly speaking it does change my life up to now.

Laboratory card member

Currently student in Nakazawa Laboratory, Tohoku University. Lab's specialty is Ultrahigh speed optical communication.

Labortory Experiment

Ultrahigh Speed Optical Communication

Masalah Bagasi yang Overweight

Kemarin saya mencoba menimbang berat bagasi saya. Ternyata tital bagasi dan tas jinjing saya 28 kg,  sedangkan saya hanya membeli 25kg.

Panik! Iya, antara saya mau nambah bagasi atau mengurangi isi bagasi. Saya sudah mau nambah dengan memanfaatkan fitur  add-ons air asia. Tapi saya kurang paham. Saya bingung kenapa saya harua beli bagasi lagi di revised itenary nya. Di sisi lain saya juga ga mau ngeluarin uang banyak mengingat low cost airlines harga bagasinya mahal banget. Apalagi kalo nambah pas check in di bandara. Harus bayar 310.000 per kilo. Sayang sekali bukan.

Ada solusi lain untuk tambah bagasi, yaitu dengan mendatangi counter air asia agar jelas dan biar sekalian dicetakkan tiketnya. Tapi saya lagi tinggal di rumah orang tua, di lamongan. Sedangkan counter air asia ada di Surabaya  yang paling dekat. Saya tidak terlalu familiar dengan kota surabaya. Beda dengan Jakarta yang meskipun ribet tapi transportasi lengkap dan selalu ada. Di surabaya saya harus naik bis kota  atau angkot yang saya tidak tahu.

Mungkin mengurangi bagasi sebanyak 4 kilo adalah pilihan terakhir saya. Walaupun agak sedih. Saya sempat browsing tentang cara mengurangi bagasi dll. Ya hasilnya sama saja. Yang jelas menyiksa saya karen saya harus bawa barang saya sendiri.

Oh iya, sebelum berangkat itu rasanya galau. Kayak sedih gitu mau ninggalin rumah. Teringan moment moment sama keluarga, teman teman di kampus. Ya saya sudah kangen saja sama teman teman kuliah. Baru 2 minggu saya tidak di kampus rasanya sudah rindu.  Sama seperti waktu graduation SMA dulu. Sedih banget harus kuliah mencar mencar dari teman teman.

What're freshman, sophomore, junior, senior,  and alumnae mean? 


Freshman is a newbie in college. He just graduated from his high school and chill the University life. Still optimistic, oftenly get confused to the path he choose ahead to survive in college life. Still pure hearted and easy to be influenced by others.
Level:
Diligence  : High
Total of having text book: Most original copy
Outfit : Neat shirt, using shoes everytime
Financial : literally safe



Sophomore  is a 2nd year student in college. Merely get used to the college, more experience.
Level:
Diligence  : Safe
Total of having text book: decreasing,  more ebook or 2nd hand book
Outfit : Neat shirt, sometimes not using shoes
Financial : balance and very safe




Junior  is a third year student in college. Literally has made a decision on what path, type of job that he wants.
Level:
Diligence  : Medium
Total of having text book: Much less
Outfit : Casual
Financial : staring to invest or build start up comapny or brave enough to travel the world means poor life





Senior is forth or last year student  in college. Projects are waiting ahead. Starting to think whether he can possibly graduate this year or not. For single man and woman starting to think their future in love life. Whether they can possibly get married soon or not. Continuing to master degree or take a full time job. Attending job interview and fair everywhere.
Level:
Diligence  : Study : least, everything which has high possibility earning money : highest
Total of having text book: almost none
Outfit : taking a bath only when about to attend job fair and interview or meet the teacher
Financial : I NEED JOB

10 Types of Cool College Student. Are you Cool?

Most final year of highschool student will cenrtainly on the stage of "what I'm gonna do after graduation"
Yes, some work hard to succeed the University Entrance Examination, some doing entrepereneurship, and some getting married (my last option tho haha).

Now, as a college student, What Type are You?

1. The Ghost

20th Century Fox / Via youtube.com


This type usually never show up in a pretty crowded campus event, attend the class once in a month but the he never miss his attendance list! Coming only in exam, mid, and final. Bravooo one!
Grade Level: Second Semester Senior
Distinctive Trait: Only appears on syllabus day, the midterm, and the final.

2. The Show-Off


It's not kinda cool one, but some who doesn't aware of his show-off-ness seeing it cool.
Grade Level: Freshman
Distinctive Trait: How do you spot a freshman that got an A on a test? Don’t worry, they’ll let you know.

3. The Late-Comer


Hey, it's wasting time make it on time. You didn't spend your time to wait someone more late than you, did ya? Pretty smart and opportunistic one. Late-Comer's way of think is cool.
Grade Level: Senior
Distinctive Trait: No matter what time of day or how important the subject matter is, this person shows up, Starbucks in hand, in the middle of the class and not-so-subtly tries to sneak in from the back.

4. The Spirit Leader


When he present a presentation in a class you'll feel it's like listening to the oration. Tough one! Absolutely PRETTY COOL!!!
Grade Level: Super Senior
Distinctive Trait: Known to say, “Winning isn’t everything, it’s the only thing.”

5. The Early Bird


Grade Level: Freshman
Distinctive Trait: Not only chooses to have an 8 a.m. class on Friday, but shows up 10 minutes early with way too much enthusiasm.

6. The Comfort King


Grade Level: Senior
Distinctive Trait: Has an overabundance of pajama attire that they wear in rotation to each and every class.

7. The FIFA/ DOTA/ PES one

Exam is in next week -> Go to mall
Exam is in three days -> watching movie
Exam is tomorrow -> overslept
Exam is in hours -> playing FIFA
Exam is in minute -> still playing FIFA
Exam is in progress -> 
Exam is over -> CONTINUE PLAYING FIFA

8. The Creative Excuse Expert


Grade Level: Typically upperclassmen
Distinctive Trait: Will create a reason (however implausible) to email the class roster to get notes from the entire semester

9. The Sleeper


Grade Level: Second Semester Junior
Distinctive Trait: Can’t manage too keep their eyes open for more than 45 seconds, usually due to working a full course load, a part-time job, and applying for unpaid internships.

10. Me    :v

Everybody knew, the coolest one. Meh.

Grade Level: Any
Distinctive Trait: Actually normal.


So, what type of college student are you?


Basic Learning and Assignment+Solution on C Programming (PART 1)

Hello guys! Welcome back to my blog.

I'm planning to be productive during my holiday. Now, I'm gotta share about my assignements on doing C Programming Class. So enjoy.
According to me, studying C is not quite hard before you know Pointer, linked-list, etc. Hahahaa~
Because what I want to show you is the basic of C, so we don't go to pointer and linked-list further ^^
**Once again, forgive me.. Some commands are in Bahasa Indonesia

1. Calculate Debet Card on C

#include
#include

//menghitung pengeluaran dari kartu debet

int main()
{
/*Declare variabel*/
int total_tabungan=500000;
int bayar;
char password[25];
int pass[4]={1,2,3,4}; //password kartu debet yang dijadikan acuan
int i;
char input;



/*Interface Program */

system("cls"); //clear sistem
for (i=0;i<100 font="" i="">
{
password[i]=getch(); 
if (password[i]=='\r') //jika command enter maka password entry berhenti
{
password[i]=NULL;
break;
}
else if (password[i]=='\b') // jika command backspace
{
if(i!=0)printf("\b \b"); // kursor kembali ke digit sebelumnya
password[i]=NULL;
password[i-1]=NULL;
i=i-2; //digit dikurang 2
if(i<-1 i="-1;</font">
continue;
}
printf("*"); //entry password ditampilkan dalam karakter * agar tak terlihat
}


printf(" %s", password);

     if(password==pass) // membandingkan nilai string password input dan password asli
{
 
system("cls");
printf("                                 ** KELOMPOK ** \n                           Adhelia Irawan | 1206245216 \n                Claudia Khansa' Atikah H. | 1206245216 \n                         Ismi Rosyiana F. | 1206245216");
printf("\n\n                           JUMLAH SISA TABUNGAN ANDA ADALAH SEBESAR  : \n");
printf("                                %d",total_tabungan);
printf("\n\nPilih transaksi yang ingin anda lakukan ");
printf("\n 1. Pembayaran (press 1)");
printf("\n 2. Tarik Tunai(press 2)");
printf("\n  Masukkan input:  ");scanf("%s", &input);
if(input=='1')
{
printf("Masukkan nominal pembayaran dalam rupiah   :  "); scanf("&d", bayar);
if(bayar<=total_tabungan)
printf(" Apakah anda yakin akan melakukan transaksi sebesar Rp %d,00 ?" , bayar);
else printf(" Maaf, saldo anda tidak mencukupi");
}
else if (input=='2')
{
system("cls");
printf("\n\n\n\n ====Terimakasih telah menggunakan kartu Debet Ceria====");
}
getch();
}

else 
{
system("cls");
printf("\n\n  Password yang anda masukkan salah,\n\n  Silahkan coba lagi \n\n  ===>1(lanjut), 2(keluar dari menu)<=== \n");
printf("\n  Masukkan input:  ");scanf("%s", &input);
if(input=='1')main();
else if (input=='2')
{
system("cls");
printf("\n\n\n\n ====Terimakasih telah menggunakan kartu Debet Ceria====");
}
else (printf("Input yang anda masukkan salah, silahkan menggesek kartu lagi"));
getch();
}


}

2. DVD Rental Program Using C


/*library declaration*/
#include
#include
#include
#include
#include
/*inisialisasi*/
void koleksi(char pilem);
int submenu(char pilih);
int booking(int y);

void selesai();
void sinopsis (char pilem);
int setting();
int returning();
char input[20];
int kode[15]={234,442,553,643,464,643,532,129,439,321,421};
int harga[15]={10000,12000,5700,4500,4000,6000,5500,3300,12500,9500,7800};
char genre[50][50]={"Thriller","Horror\t","Action\t","Family\t","Drama\t","Drama\t","Shonen\t","Drama\t","Adventure","Fiction\t"};
char bulanNum[15][15]={"Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"};
char judul[50][50]={"The Amazing Spiderman\t","Insidious 2\t\t\t","Fast and Furious 6\t\t","Lilo and Stich\t\t","Les Miserables\t\t","Juno\t\t\t\t","Naruto\t\t\t","August Rush\t\t\t","The Spiderwick Chronicles\t","Kamen Rider\t\t\t"};
char header[500]={"===============================================================================\n\t\t\t\tDVD RENTAL\n\n\t\t\tProgram Rental DVD Kelompok 3\n===============================================================================\n"};
int balik,set_tanggal=22052014,set_denda=1000,rtrn,y,dvd;
char pilem;
int status[15]={3,1,1,0,4,0,1,2,1,3},c=0;
int *p;


struct data{ //struct declaration
char username[10];
int tglpinjam,date[6],tanggal,tanggalKembali,bulanKembali,j,tahun,bulan,i,tahunKembali,tanggalNow,bulanNow,tahunNow,savetemp;
char namaDepan[20];
char namaBelakang[20];
};

struct data user[20];

int main() { //main program
char choose;
char back;
system("cls");
system("color F0");
printf("%s\n",header);

printf("\t\t   _______________               |** **|________\n");
printf("\t\t   |  ___________  |             |**-**|_____ _  |\n");
printf("\t\t   | |           | | R E N T A L | |           | |\n");
printf("\t\t   | |   0   0   | |    D V D    | |   0   0   | |\n");
printf("\t\t   | |     -     | |             | |     -     | |\n");
printf("\t\t   | |   (___)   | |  **** ****  | |   (___)   | |\n");
printf("\t\t   | |___     ___| | *********** | |___________| |\n");
printf("\t\t   |_____|*_*|_____| *********** |_______________|\n");
printf("\t\t     _|__|* *|_|_.....******** ...._ |________|_\n");
printf("\t\t --------------------   *** --------------------\n");
printf("\t\t ----------------------  * --------------------\n\n");

printf("\t\t\tTekan Enter untuk masuk main menu...\n\n");
getch();
system("cls");
system("color 0F");
printf("%s",header);
printf("\t\t\t      Menu\n\n");
printf("\t\t\t\t1. Daftar Koleksi\n");
printf("\t\t\t\t2. Peminjaman\n");
printf("\t\t\t\t3. Pengembalian\n");
printf("\t\t\t\t4. Setting Tanggal&Denda\n");
printf("\t\t\t   Masukkan input : \n\n");
scanf("%s",&choose);
submenu(choose);

return 0;
} /*end of main function*/
int berakhir()
{
printf("%s\n",header);
selesai();
}
bool check_int(char a[4]){
    int k;
    int n=strlen(a);
  for(k = 0; k < n; k++){
    if(!isdigit(a[k])){
      return true;
    }
  };
  return false;
}
int submenu(char pilih)
{
char pilem;
char kaset[3];

switch(pilih)

{
case'1':
system("cls");
printf("%s",header);
for(user[c].i=0;user[c].i<10 c="" i="" p="" user=""> {
printf("%d. %s\n",user[c].i+1,judul[user[c].i]);
}
printf("\n\t\t\tMasukkan kode DVD (tekan 0 untuk exit) : ");
scanf("%s",&pilem);
if(pilem=='0')main();
koleksi(pilem);
break;

case '2':
system("cls");
system("color 0E");
printf("%s",header);
printf("\n\tJUDUL DVD\t\tGENRE\t\tKODE\tHARGA\t       STOCK\n----------------------------------------------------------------------------\n");
for(user[c].i=0;user[c].i<10 c="" i="" p="" user=""> {
printf("%d. %s%s\t%d\t%d\t\t%d\n",user[c].i+1,judul[user[c].i],genre[user[c].i],kode[user[c].i],harga[user[c].i],status[user[c].i]);
}

printf("\nKeterangan:\nSTOCK ---> JUMLAH AVAILABLE\tSTATUS 0---> NON AVAILABLE\n");
printf("\n\t\tMasukkan kode DVD untuk booking(0 untuk kembali)  ");
scanf("%s",&kaset);
        while(check_int(kaset))
{
   printf("\n\t\t\tInput salah!\n\t\t\tPilih judul DVD (tekan 0 untuk exit) : ");
            scanf("%s",&kaset);
}
        dvd= strtol(kaset, NULL, 10);
system("cls");
system("color 0F");
if(dvd==0)main();
else
{
for (user[c].i=0;user[c].i<15 c="" i="" p="" user=""> {
if (dvd==kode[user[c].i])
{
if (status[user[c].i]==0)
{
printf("\n\n\t\tDVD yang anda pilih sedang NON AVAILABLE.\n\t\t\tSilahkan pilih yang lain \1\n");
getch();submenu('2');
}
else{
booking(dvd);
}
break;
}
}
if (user[c].i==15)
{
printf("\n\t\tKODE SALAH, masukan kode DVD lagi\1");
getch();submenu('2');
}

}
break;

case '3':returning();break;

case '4':setting();break;

default:
printf("Input Salah. Tekan Enter dan input lagi! ");getch();main();
}
}


void koleksi(char pilem)
{
char back;
system("cls");
printf("%s",header);
sinopsis(pilem);
printf("\n\nMasukkan 1 untuk kembali ke main menu, 0 untuk exit -> ");scanf("%s",&back);
if(back=='1')submenu('1');
else if(back=='0')
{
system("cls");
selesai();
}
else
{
system("cls");
printf("\n\n\n\t\t\tINPUT SALAH!\n\t\tKlik enter untuk kembali");
getch();main();
}

}

void sinopsis (char pilem)
{
switch (pilem)
{
case '1':
printf("\n\t\t\t    THE AMAZING SPIDERMAN 2\n\n");
printf("GENRE :\n-----\nthriller\n\n");
printf("SINOPSIS :\n--------\nDiceritakan hubungan Peter dan Gwen (Emma Stone) masih terjalin dengan baik.\nMeski terkadang pesan terakhir ayah Gwen untuk menjauhi anaknya masih\nbegitu mengganggunya. Ditengah kesibukkannya, muncul masalah baru, sebuah\npenjahat kuat mengancam keselamatan penduduk kota New York. \n\n");
printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
break;
case '2':
printf("\n\t\t\t    INSIDIOUS  2\n\n");
printf("GENRE :\n-----\nHorror\n\n");
printf("SINOPSIS :\n--------\nFilm Insidious 2 akan memperlihatkan kehidupan keluarga Josh Lambert yang mulai hidup normal. Namun semuanya berubah mencekam ketika dentingan piano mulai\nmengalun sendiri, benda-benda mati yang bergerak sendiri dan sesosok hantu\nwanita dengan pakaian kuno menampakan wujudnya kembali. \n\n");
printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
break;
case '3':
printf("\n\t\t\t  Fast and Furious 6\n\n");
printf("GENRE :\n-----\nCrime Fiction, Action\n\n");
printf("SINOPSIS :\n--------\n Alur cerita mungkin masih mengacu pada perseteruan dua kelompok yang sama-sama berniat mencuri benda-benda berharga. Dan Dwayne Johnson akan terus memburu\nDom yang diperankan oleh Vin Diesel. Sosok Letty akan hadir kembali di Fast\nSix ini yang diperankan oleh Michelle Rodriguez. \n\n");
printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
break;
case '4':
printf("\n\t\t\t   Lilo and Stich 2\n\n");
printf("GENRE :\n-----\nFamily\n\n");
printf("SINOPSIS :\n--------\nStitch masih belum terbiasa tinggal di Bumi. Lilo mencoba menghiburnya\ndengan mengatakan bahwa Stitch adalah sahabat yang istimewa bagi dirinya.\nTiba-tiba ada suara benturan keras dari luar. \n\n");
printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
break;
case '5':
printf("\n\t\t\t   Les Miserabeles\n\n");
printf("GENRE :\n-----\nDrama\n\n");
printf("SINOPSIS :\n--------\nJean Valjean dijatuhi hukuman penjara selama 19 tahun gara-gara mencuri\nsebongkah roti. Setelah bebas, Valjean mengubah namanya menjadi Monsieur\nMadeleine, dan berhasil menjadi seorang wali kota di sebuah kota kecil di\nPerancis.\n\n");
printf("RATING :\n-----\n\6 \6 \6 \n");
break;
case '6':
printf("\n\t\t\t   Juno\n\n");
printf("GENRE :\n-----\nDrama, Romance\n\n");
printf("SINOPSIS :\n--------\nAwalnya, Juno (Ellen Page) terlibat hubungan seks pra nikah dengan pacarnya\nPaulie Bleeker (Michael Cera). Hubungan ini mengakibatkan Juno yang baru\nberusia 16 tahun hamil.\n\n");
printf("RATING :\n-----\n\6 \6\n");
break;
case '7':
printf("\n\t\t\t   Naruto \n\n");
printf("GENRE :\n-----\nComedy, Action, Shonen\n\n");
printf("SINOPSIS :\n--------\nKekacauan terjadi di desa Konoha dan korban banyak berjatuhan....akhirnya ada\nseseorang yang berhasil menyegel Kyuubi itu ke tubuh Naruto, putranya\nsendiri,seseorang yang berhasil menyegel siluman rubah ekor itu dikenal sebagai Yondaime Hokage,Hokage ke 4 atau Namikaze Minato.\n\n");
printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
break;
case '8':
printf("\n\t\t\t   August Rush\n\n");
printf("GENRE :\n-----\nthriller\n\n");
printf("SINOPSIS :\n--------\nFilm ini bercerita tentang seorang anak bernama Evan Taylor (Freddie Highmore)\nyang percaya dengan musik. Evan memiliki bakat bermain musik luar biasa\ndari orang tuanya. Ia bisa mendengar musik dari desauan angin, gemericik air,\nbahkan kilau cahaya. \n\n");
        printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
break;
case '9':
printf("\n\t\t\t   The Spiderwick Chronicles\n\n");
printf("GENRE :\n-----\nthriller\n\n");
printf("SINOPSIS :\n--------\nFilm ini dibuka dengan Arthur Spiderwick (David Strathairn) berjalan cepat-cepat ke ruang kerjanya. Ruangan yang dipetieskan dengan bug dan makhluk aneh\ndalam stoples. Dia mulai panik mengumpulkan buku, dan ketika ia mengikat dan\nperangko tandanya ke cover, jijik suara aneh yang terdengar di luar, makhluk dari segala\nmacam mengeluh. \n\n");
        printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
        break;
case '.':
printf("\n\t\t\t    Kamen Rider\n\n");
printf("GENRE :\n-----\nthriller\n\n");
printf("SINOPSIS :\n--------\nSeri ini berlangsung di dunia yang sedang dirongrong oleh organisasi teroris\nmisterius bernama Shocker yang ingin menguasai dunia. Shocker merekrut agen-agennya melalui penculikan, mengubahnya menjadi cyborg/mutan, lalu mencuci otak mereka. Kamen Rider Ichigo/Hongo Takeshi adalah seorang mahasiswa biasa yang mempelajari biokimia di universitas Jonan dan seorang pembalap motor amatir.\n\n");
        printf("RATING :\n-----\n\6 \6 \6 \6 \6 \n");
break;
default:
printf("Input Salah. Tekan Enter dan input lagi! ");getch();submenu('1');
}
}
int pangkat(int x, int y)
{
int r = 1;
for(user[c].i=0; user[c].i r = r * x;
}
return r;
}

int check_tanggal(char tanggalan[8])
{
    int c= strtol(tanggalan, NULL, 10);
    int bln=0,thn=0;
    if (strlen(tanggalan)!=8||check_int(tanggalan))
    {
        minta_tanggal();
    }
    else
    {   int s;

        for (s=0;s<4 p="" s="">        {
thn=thn+(c%10*pangkat(10,s));
c=(c-c%10)/10;
        }
       for (s=0;s<2 p="" s="">        {
bln=bln+(c%10*pangkat(10,s));
c=(c-c%10)/10;
        }
        if (bln>12)
        {
           minta_tanggal();
        }
        else
        {
            int x=max_hari(bln);
            if (c>x)
            {
             minta_tanggal();
            }
            else
            {
                int f=strtol(tanggalan, NULL, 10);
                return f;
            }

        }

    }
}
int minta_tanggal()
{   char tanggalan[8];
    printf("Input tanggal salah,silahkan input lagi\nTanggal pinjam (ddmmyyyy): ");scanf("%s",&tanggalan);check_tanggal(tanggalan);
}

int booking(int y)
{
    int tanggalan[8];
system("cls");

printf("%s",header);

printf("\t\t\tISI DATA\n\n");
c++;
printf("Username\t: ");scanf("%s",&user[c].username);
printf("Nama Depan\t: ");scanf("%s",&user[c].namaDepan);
printf("Nama belakang\t: ");scanf("%s",&user[c].namaBelakang);
printf("Tanggal pinjam (ddmmyyyy): ");scanf("%s",&tanggalan);

    user[c].tglpinjam= check_tanggal(tanggalan);
user[c].tahun=0;
for (user[c].i=0;user[c].i<4 c="" i="" p="" user=""> {
user[c].tahun=user[c].tahun+(user[c].tglpinjam%10*pangkat(10,user[c].i));
user[c].tglpinjam=(user[c].tglpinjam-user[c].tglpinjam%10)/10;
}
user[c].bulan=0;
for(user[c].i=0;user[c].i<2 c="" i="" p="" user=""> {
user[c].bulan=user[c].bulan+(user[c].tglpinjam%10*pangkat(10,user[c].i));
user[c].tglpinjam=(user[c].tglpinjam-user[c].tglpinjam%10)/10;
}
int x;
int month=12;
x=max_hari(user[c].bulan);
user[c].tanggalKembali=user[c].tglpinjam+7;
if (user[c].tanggalKembali>x)
{   user[c].tanggalKembali=user[c].tanggalKembali-x;
user[c].bulanKembali=user[c].bulan+1;
user[c].tahunKembali=user[c].tahun;
if(user[c].bulanKembali>month)
{
user[c].bulanKembali=1;
user[c].tahunKembali=user[c].tahun+1;
}
}
else
{
user[c].bulanKembali=user[c].bulan;
user[c].tahunKembali=user[c].tahun;
}
pinjam(status,pilem);
system("cls");
printf("%s",header);
printf("\t\t\t\tS U M M A R Y\n\t\t-------------------------------------------\n\n");
printf("Username\t\t: %s\n",user[c].username);
printf("Nama\t\t\t: %s %s\n",user[c].namaDepan,user[c].namaBelakang);
for(user[c].i=0;user[c].i<10 c="" i="" p="" user=""> {
if(y==kode[user[c].i])
{
user[c].savetemp = user[c].i;
status[user[c].i]-=1;
printf("DVD yang dipinjam\t: ");
printf("%s\n",judul[user[c].i]);
printf("Tanggal Pinjam\t\t: %d %s %d\n",user[c].tglpinjam,bulanNum[user[c].bulan-1],user[c].tahun);
printf("Tanggal Kembali\t\t: %d %s %d\n",user[c].tanggalKembali,bulanNum[user[c].bulanKembali-1],user[c].tahunKembali);
printf("Total biaya\t\t: Rp %d\n",harga[user[c].i]);
printf("\nTekan 1 untuk kembali, 0 untuk exit..");scanf("%s",&pilem);
if(pilem=='1')main();
else {
system("cls");
berakhir();
}
}
}

}

int pinjam (int status[15], int nama)
{   p=&status[0];
int m;
for (m=0;m<15 m="" p=""> {
if (nama==kode[m])
{
int k=status[m];
status[m]=k-1;
break;
}
}
}
int kembali(int status [15],int nama)
{
p=&status[0];
int m;
for (m=0;m<15 m="" p=""> {
if (nama==kode[m])
{
int k=status[m];
status[m]=k+1;
break;
}
}
}
int max_hari(int bulan)
{
if(bulan==1||bulan==3||bulan==5||bulan==7||bulan==8||bulan==10||bulan==13)
{
return 31;
}
else if(bulan==2)
{
return 28;
}
else
{
return 30;
}
}
int returning()
{
system("cls");
printf("%s",header);
printf("\n\t\t\t\tP E N G E M B A L I A N\n\t\t\t--------------------------------------\n\n");
printf("Masukkan 0 untuk kembali ke main menu  \n\n\n");
printf("Username\t\t\t\t: ");scanf("%s",&input);

if(input[0]=='0')
{
main();
}

for(c=0;c<20 c="" p=""> {

if(strcmp(input,user[c].username)==0)
{
for (user[c].j=0;user[c].j<10 c="" j="" p="" user=""> {


printf("\n\nDATA PINJAM:\n\n");
printf("Kode DVD yang dipinjam\t\t\t: %d\n",kode[user[c].savetemp]);
printf("Judul DVD yang dipinjam\t\t\t: %s\n",judul[user[c].savetemp]);
printf("Tanggal Pinjam\t\t\t\t: %d %s %d\n",user[c].tglpinjam,bulanNum[user[c].bulan-1],user[c].tahun);
printf("Tanggal Kembali\t\t\t\t: %d %s %d\n",user[c].tanggalKembali,bulanNum[user[c].bulanKembali-1],user[c].tahunKembali);
// kembali(status,kode[user[c].i]);
user[c].tanggalNow=set_tanggal;
user[c].tahunNow=0;
for (user[c].i=0;user[c].i<4 c="" i="" p="" user=""> {
user[c].tahunNow=user[c].tahunNow+(user[c].tanggalNow%10*pangkat(10,user[c].i));
user[c].tanggalNow=(user[c].tanggalNow-user[c].tanggalNow%10)/10;
}
user[c].bulanNow=0;
for(user[c].i=0;user[c].i<2 c="" i="" p="" user=""> {
user[c].bulanNow=user[c].bulanNow+(user[c].tanggalNow%10*pangkat(10,user[c].i));
user[c].tanggalNow=(user[c].tanggalNow-user[c].tanggalNow%10)/10;
}
rtrn=0;
if(user[c].bulanNow>user[c].bulanKembali||user[c].tanggalNow>user[c].tanggalKembali||user[c].tahunNow>user[c].tahunKembali)
{
if(user[c].tahunNow>user[c].tahunKembali)
{
for (user[c].i=12;user[c].i>user[c].bulanKembali;user[c].i--)
{
rtrn=rtrn+max_hari(user[c].i);
}
if(user[c].tanggalNow {
for(user[c].i=1;user[c].i {
rtrn=rtrn+max_hari(user[c].i);
}
rtrn=rtrn+(user[c].tanggalNow+max_hari(user[c].bulanNow-1)-user[c].tanggalKembali);
}
else
{
for(user[c].i=1;user[c].i<=user[c].bulanNow;user[c].i++)
{
rtrn=rtrn+max_hari(user[c].i);
}
rtrn=rtrn+(user[c].tanggalNow-user[c].tanggalKembali);
}
}
else
{   int k=user[c].bulanKembali;
if (user[c].tanggalNow {
for(user[c].i=1;user[c].i<(user[c].bulanNow-user[c].bulanKembali);user[c].i++)
{
rtrn=rtrn+max_hari(k);
k++;
}
rtrn=rtrn+(user[c].tanggalNow+max_hari(user[c].bulanNow-1)-user[c].tanggalKembali);
}
else
{
for(user[c].i=1;user[c].i<=(user[c].bulanNow-user[c].bulanKembali);user[c].i++)
{
rtrn=rtrn+max_hari(k);
k++;
}
rtrn=rtrn+(user[c].tanggalNow-user[c].tanggalKembali);
}
}
printf("Keterlambatan pengembalian\t\t: %d hari\n",rtrn);
printf("Denda\t\t\t\t\t: %d",set_denda*rtrn);
}



else
printf("\n\n\t\t-NO CHARGE-\n");


printf("\n\nTekan 1 untuk kembali,2 untuk mengembalikan DVD, 0 untuk exit... ");scanf("%d",&balik);
if (balik==1)
{
main();
}
else if(balik==0){
system("CLS");
berakhir();
getch();
// printf("%s",header);
// printf("%s",footer);
}
else{

status[user[c].savetemp]+=1;
system("cls");
printf("%s\n\n",header);
printf("Terimakasih telah mengembalikan DVD");
printf("\n\nTekan enter untuk kembali...");
getch();
main();
}/*end else*/

} /*end for*/
} /*end string comparasion*/
} /*end for conter struct*/

system("cls");
printf("%s",header);
printf("\n\nMaaf, username tidak terdaftar!\n\nSilahkan tekan enter...");
getch();
returning();

}

int setting()
{
    system("cls");
    printf("%s",header);
char balik;
printf("Set tanggal hari ini (ddmmyyyy):\n");scanf("%d",&set_tanggal);
if(set_tanggal%10000!=2014)
    {
        printf("Input salah! Tekan enter dan input lagi");getch();
        setting();
    }
printf("Set denda perhari\t:\n");scanf("%d",&set_denda);
system("cls");
printf("%s",header);
printf("\nDATE AND CHARGE ALREADY SETTLED!");
printf("\n\nTekan 1 untuk back to main menu, 0 untuk exit program");scanf("%s",&balik);
if (balik=='1')main();
else {
system("cls");
berakhir();
}

}

void selesai()
{

int blink;
for(blink = 0; blink < 4; blink++)
{
printf("\n\3   \3   \3    \3\t\3  \3  \3  \3");
Sleep(50);
system("cls");
printf("");
Sleep(50);
system("cls");
printf("*  *  *  *\t  *  \3  \3  \3  \3  * \t*  *  *");
Sleep(50);
system("cls");
printf("\n\n\n*   *   *  \3\t\t    *    *    *    \3    \3    \3 ");
system("cls");
printf("\n\n\n\n\t\t\t\t \3  *  *  *  *  *  *  *  *  \3   \3  \3  \3 ");
Sleep(50);
system("cls");
printf("\n\n\n\n\n*   *   *   *  *  *  *  *  *  *  *  \3  \3   \3  \3  \3 ");
Sleep(50);
system("cls");
printf("\n\n\n\n\n\3   \3   \3   \3  \3  \3  \3  \3  \3  \3  \3  \3  \3   \3  \3  \3 ");
Sleep(50);
system("cls");
}
    system("color 0B");
printf("\n\n\n|:::::::::::::| |::    :    |:::::|    |::   :|  |::  :::   ::::::::\n");
printf("    ::::        |::    :   |:     :|   |: :: :|  |:: ::     :\n");
printf("    ::::        |:::::::  |:::::::::|  |:  :::|  |:::        ::::::\n");
printf("    ::::        |::    :  |:       :|  |:    :|  |:::              ::\n");
printf("    ::::        |::    :  |:       :|  |:    :|  |:: ::             :\n");
printf("    ::::        |::    :  |:       :|  |:    :|  |::   :::  ::::::::\n");
getch();
}

Controlling a Robot using PSX (Arduino based)

Here's the code about how I control the robot using PSX and arduino Mega 2560. I make the code in such a modular way(no need but it's ok, forgive me lol)

Some command is in Bahasa Indonesia.

1. Main Program which call every tabs

/* bismillahirrohmaanirrohiim
ALLAHUAKBAR
=====================18 APRIL 2014====================================*/
/*  MASTER
ChangeLog: 1. slider 2. single motor 3. otomatisasi
*/


#include  //PS2 Library
#define naik 0
#define turun 1

//initialization
PS2X ps2x;
int PS2_error = 0;
int PS2_AnalogLX = 0;
int PS2_AnalogLY = 0;
int PS2_AnalogRX = 0;
int PS2_AnalogRY = 0;
int translateX, translateY, rotateTheta;


void setup() {
  Serial.begin(57600);

  PS2_error = ps2x.config_gamepad(50,51,52,53, true, false);   //(clock, command, attention, data, Pressures?, Rumble?)
  if (PS2_error == 0) Serial.println("SIAP"); //stick detected
  else if(PS2_error == 1)  Serial.println("Gak ada stik, cek kabel");
  else if(PS2_error == 2)  Serial.println("Stik terdeteksi, tapi ga bisa nerima command");
  else if(PS2_error == 3)  Serial.println("Stik tidak bisa memasuki mode Pressure, hilangkan mode melalui kodingan");

  slaveInit();
  motorInit();
  seesawInit();
  gripperInit();
  sliderInit();
  liftingInit();
  pendorongInit();
  singleMotorInit();
}

void loop()
{

  if(PS2_error != 0)
  {
    delay(500);
    lifting(0,0);
    return;
  }
  else
  {
    ps2x.read_gamepad();          //read controller and set large motor to spin at 'vibrate' speed
 
    //kalo stik terlepas biar gak jalan sendiri
    if(ps2x.Analog(PSS_LY) == 255 && ps2x.Analog(PSS_LX) == 255 && ps2x.Analog(PSS_RY) == 255 && ps2x.Analog(PSS_RX) == 255)
    {
      PS2_AnalogLY = 0;
      PS2_AnalogLX = 0;
      PS2_AnalogRY = 0;
      PS2_AnalogRX = 0;
      Serial.println("STIK TERLEPAS");
      motorDrive(0,0,0);
      while(1);
    }

    else if(ps2x.Button(PSB_L2)) // turbo speed
    {
      PS2_AnalogLY = ((ps2x.Analog(PSS_LY) - 128));
      PS2_AnalogLX = ((ps2x.Analog(PSS_LX) - 128));
      PS2_AnalogRY = ((ps2x.Analog(PSS_RY) - 128));
      PS2_AnalogRX = ((ps2x.Analog(PSS_RX) - 128));
    }

    else if(ps2x.Button(PSB_L1)) // slow mo banget seperempat speed
    {
      PS2_AnalogLY = (int)((ps2x.Analog(PSS_LY) - 128)/4);
      PS2_AnalogLX = (int)((ps2x.Analog(PSS_LX) - 128)/4);
      PS2_AnalogRY = (int)((ps2x.Analog(PSS_RY) - 128)/4);
      PS2_AnalogRX = (int)((ps2x.Analog(PSS_RX) - 128)/4);
    }


    else  //normal speed
    {
      PS2_AnalogLY = (int)((ps2x.Analog(PSS_LY) - 128)/2);
      PS2_AnalogLX = (int)((ps2x.Analog(PSS_LX) - 128)/2);
      PS2_AnalogRY = (int)((ps2x.Analog(PSS_RY) - 128)/2);
      PS2_AnalogRX = (int)((ps2x.Analog(PSS_RX) - 128)/2);
    }

    //    Serial.print("Stick Values:");
    //    Serial.print(PS2_AnalogLX, DEC);
    //    Serial.print(" ,");
    //    Serial.print(PS2_AnalogLY, DEC);
    //    Serial.print(" ,");                  
    //    Serial.print(PS2_AnalogRX, DEC);
    //    Serial.print(",");
    //    Serial.println(PS2_AnalogRY, DEC);

    translateX= PS2_AnalogLX*2;
    translateY= PS2_AnalogLY*2;
    rotateTheta= PS2_AnalogRX*-2;  

    omniDrive(translateX,translateY,rotateTheta);  // kalo mau pake pwm master doang
    //slaveOmniPWM(translateX,translateY,rotateTheta);  // kalo mau pake pwm tp master slave
    //slaveOmniRPM(translateX,translateY,rotateTheta);  // kalo mau pake rpm master slave

    if(ps2x.ButtonPressed(PSB_PINK))
    {
       push();
    }

    if(ps2x.ButtonPressed(PSB_RED))
    {
      gripping(); // grip depan
    }

    if(ps2x.ButtonPressed(PSB_BLUE))
    {
      seesaw_on(); // ayunin jungkat jungkit
    }
 
    if(ps2x.Button(PSB_PAD_RIGHT))
    {
      slider(120,naik);
    }

    if(ps2x.ButtonReleased(PSB_PAD_RIGHT))
    {
      slider(0,turun);
    }
 
    if(ps2x.Button(PSB_PAD_LEFT))
    {
       slider(120,turun);
    }
 
     if(ps2x.ButtonReleased(PSB_PAD_LEFT))
    {
      slider(0,naik);
    }

    if(ps2x.Button(PSB_PAD_UP))
    {
       lifting(250,turun);
    }
 
    if(ps2x.ButtonReleased(PSB_PAD_UP))
    {
      lifting(0,naik);
    }
 
    if(ps2x.Button(PSB_PAD_DOWN))
    {
      lifting(250,naik);
    }
    if(ps2x.ButtonReleased(PSB_PAD_DOWN))
    {
      lifting(0,turun);
    }
 
    if (ps2x.ButtonPressed(PSB_GREEN))
    {
      push();
    }
 
 
    if (ps2x.ButtonReleased(PSB_GREEN))
    {
       motor(0,100,95,1,1,0,700);
       motor(0,0,0,0,0,0,100);
    }
 
//        if (ps2x.ButtonPressed(PSB_R1))
//    {
//  
//    }
 
 
    if (ps2x.Button(PSB_R1))
    {
       slider(130,naik);
       lifting2();
    }
 
    if (ps2x.ButtonReleased(PSB_R1))
    {
             slider(0,turun);
           lifting(0,naik);
    }
        if (ps2x.Button(PSB_R2))
    {
       slider(130,turun);
       lifting3();
    }
 
    if (ps2x.ButtonReleased(PSB_R2))
    {
             slider(0,naik);
           lifting(0,turun);
    }

//
//    if(ps2x.ButtonReleased(PSB_PINK))
//    {
//       //diisi nanti
//    }
//  
//     if(ps2x.Button(PSB_GREEN))
//    {
//       //diisi nanti
//    }
//
//    if(ps2x.ButtonReleased(PSB_GREEN))
//    {
//       //diisi nanti
//    }
//    if(ps2x.ButtonPressed(PSB_PAD_RIGHT))
//    {
//      ping(1);
//    }
//
//    if(ps2x.ButtonPressed(PSB_PAD_UP))
//    {
//      ping(2);
//    }
//    if(ps2x.ButtonPressed(PSB_PAD_LEFT))
//    {
//
//      ping(3);
//    }

  }
}


2.  Actuator's Contoller


#define GRIPPER_PIN 32

char grip;

void gripperInit()
{
  pinMode(GRIPPER_PIN,OUTPUT);
  digitalWrite(GRIPPER_PIN,HIGH);
}

void gripping ()
{
  if(grip==1)
  {
    grip=0;
    Serial.println("GRIPPER ACTIVATED");
  }
  else
  {
    grip=1;
    Serial.println("GRIPPER DEACTIVATED");
  }
  digitalWrite(GRIPPER_PIN,grip);
}

#define LIFTING_PWM_PIN 2
#define LIFTING_CS_PIN 26
#define MOTOR_CAP 255

void liftingInit()
{
pinMode(LIFTING_PWM_PIN,OUTPUT);
pinMode(LIFTING_CS_PIN,OUTPUT);
digitalWrite(LIFTING_CS_PIN,LOW);
analogWrite(LIFTING_PWM_PIN,0);
attachInterrupt(3,lifting2,CHANGE);
attachInterrupt(2, lifting3, CHANGE);
}

void lifting(int speed, int arah)
analogWrite(LIFTING_PWM_PIN,speed);
digitalWrite(LIFTING_CS_PIN,arah);
}

void lifting2()
analogWrite(LIFTING_PWM_PIN,250);
digitalWrite(LIFTING_CS_PIN,1);
}


void lifting3()
analogWrite(LIFTING_PWM_PIN,250);
digitalWrite(LIFTING_CS_PIN,0);
}

void lifting_d(int speed, int arah,int time)
analogWrite(LIFTING_PWM_PIN,speed);
digitalWrite(LIFTING_CS_PIN,arah);
delay(time);
}

#define PENDORONG_PIN 31

char pendorong;

void pendorongInit()
{
  pinMode(PENDORONG_PIN,OUTPUT);
  digitalWrite(PENDORONG_PIN,LOW);
}

void push()
{
  if(pendorong==1)
  {
    pendorong=0;
  //  Serial.println("GRIPPER ACTIVATED");
  }
  else 
  {
    pendorong=1;
   // Serial.println("GRIPPER DEACTIVATED");
  }
  digitalWrite(PENDORONG_PIN,pendorong);
}

#define SEESAW_PIN 30

char seesaw;

void seesawInit()
{
  pinMode(SEESAW_PIN,OUTPUT);
  digitalWrite(SEESAW_PIN,LOW);
}


void seesaw_on ()
{
  if(seesaw==1)
  {
    seesaw=0;
    Serial.println("SEESAW NAIK");
  }
  else 
  {
    seesaw=1;
    Serial.println("SEESAW TURUN");
  }
  digitalWrite(SEESAW_PIN,seesaw);
}

3. Motor Control


#define CSB 28
#define CSC 29
#define CSA 27
#define PWMB 4
#define PWMC 9
#define PWMA 3
#define CCW 1
#define CW 0
#define MOTOR_CAP 255 //max 255

int lastA = 0, lastB = 0, lastC = 0, last_delay = 0;
byte stopA = 0, stopB = 0, stopC = 0;


// MOTOR INIT
void motorInit()
{
   pinMode(CSA,OUTPUT);
   pinMode(CSB,OUTPUT);
   pinMode(CSC,OUTPUT);
   digitalWrite(CSA,CCW);
   digitalWrite(CSB,CCW);
   digitalWrite(CSC,CCW);
   
   pinMode(PWMA,OUTPUT);
   pinMode(PWMB,OUTPUT);
   pinMode(PWMC,OUTPUT);
}
//************************************
// Motor A
//************************************
void motor_A(int pwm)
{
  if(pwm>MOTOR_CAP) pwm = MOTOR_CAP;
  else if(pwm<-motor_cap pwm="-MOTOR_CAP;</div">
  
  if(pwm>0)
  {
    digitalWrite(CSA,CCW);
    analogWrite(PWMA,pwm);
    stopA = 1;
    if(lastA < 0) last_delay = 1;
  }
  else if(pwm<0 div="">
  {
    digitalWrite(CSA,CW);
    analogWrite(PWMA,-1*pwm);
    stopA = 1;
    if(lastA > 0) last_delay = 1;
  }
  else
  {
    if(stopA == 0) return;
    else if(digitalRead(CSA) == CCW)
    {
      digitalWrite(CSA,CW);
      analogWrite(PWMA,0);
      stopA = 0;
      last_delay = 1;
    }
    else if(digitalRead(CSA) == CW)
    {
      digitalWrite(CSA,CCW);
      analogWrite(PWMA,0);
      stopA = 0;
      last_delay = 1;
    }
  }
  lastA = pwm;
}
//************************************
// Motor B
//************************************
void motor_B(int pwm)
{
  if(pwm>MOTOR_CAP) pwm = MOTOR_CAP;
  else if(pwm<-motor_cap pwm="-MOTOR_CAP;</div">
  
  if(pwm>0)
  {
    digitalWrite(CSB,CCW);
    analogWrite(PWMB,pwm);
    stopB = 1;
    if(lastB < 0) last_delay = 1;    
  }
  else if(pwm<0 div="">
  {
    digitalWrite(CSB,CW);
    analogWrite(PWMB,-1*pwm);
    stopB = 1;
    if(lastB > 0) last_delay = 1;
  }
  else
  {
    if(stopB == 0) return;
    else if(digitalRead(CSB) == CCW)
    {
      digitalWrite(CSB,CW);
      analogWrite(PWMB,0);
      stopB = 0;
      last_delay = 1;
    }
    else if(digitalRead(CSB) == CW)
    {
      digitalWrite(CSB,CCW);
      analogWrite(PWMB,0);
      stopB = 0;
      last_delay = 1;
    }
  }
  lastB = pwm;
}
//************************************
// Motor C
//************************************
void motor_C(int pwm)
{
  if(pwm>MOTOR_CAP) pwm = MOTOR_CAP;
  else if(pwm<-motor_cap pwm="-MOTOR_CAP;</div">
  
  if(pwm>0)
  {
    digitalWrite(CSC,CCW);
    analogWrite(PWMC,pwm);
    stopC = 1;
    if(lastC < 0) last_delay = 1;
  }
  else if(pwm<0 div="">
  {
    digitalWrite(CSC,CW);
    analogWrite(PWMC,-1*pwm);
    stopC = 1;
    if(lastC > 0) last_delay = 1;
  }
  else
  {
    if(stopC == 0) return;
    else if(digitalRead(CSC) == CCW)
    {
      digitalWrite(CSC,CW);
      analogWrite(PWMC,0);
      stopC = 0;
      last_delay = 1;
    }
    else if(digitalRead(CSC) == CW)
    {
      digitalWrite(CSC,CCW);
      analogWrite(PWMC,0);
      stopC = 0;
      last_delay = 1;
    }
  }
  lastC = pwm;
}

//************************************
//Motor Drive Function, -255 ~ 255
//************************************
void motorDrive(int va,int vb,int vc)
{
  motor_A(va);
  motor_B(vb);
  motor_C(vc);
  if(last_delay==1)
  {
    delay(100);
    last_delay = 0;
    Serial.println("delayed");
  }
}

void omniDrive(int x, int y, int rot) //putaran positif searah jarum jam
{
  int va,vb,vc;
  va = 0.333*x - 0.572*y + 0.333*rot;
  vb = 0.333*x + 0.572*y + 0.333*rot;
  //vc = -0.667*x + 0.333*rot;
  vc = -0.667*x + 0.333*rot;
  
  motorDrive(va,vb,vc);
  
  /*
  Serial.print(x,DEC);
  Serial.print("\t");
  Serial.print(y,DEC);
  Serial.print("\t");
  Serial.println(rot,DEC);
  */
//  Serial.print(va,DEC);
//  Serial.print(" ");
//  Serial.print(vb,DEC);
//  Serial.print(" ");
//  Serial.print(vc,DEC);
//  Serial.println();
  
}

You can get the full code. It's easy just subscribe my blog and left the comment. I'll give you the link