Anda di halaman 1dari 5

LAPORAN PRAKTIKUM TEKNIK ANTAR MUKA RUNNING LED

Disusun Oleh:

Robiatul Adawiyah

5215107328

PENDIDIKAN TEKNIK ELEKTRONIKA TEKNIK ELEKTRO UNIVERSITAS NEGERI JAKARTA 2013

A. Judul Percobaan Running Led B. Tujuan Dapat membuat simulasi running led menggunakan Visual Basic C. Alat dan Bahan Laptop Sofware Visual Basic 6.0 D. Teori Dasar Bahasa Basic pada dasarnya adalah bahasa yang mudah dimengerti sehingga pemrograman di dalam bahasa Basic dapat dengan mudah dilakukan meskipun oleh orang yang baru belajar membuat program. Hal ini lebih mudah lagi setelah hadirnya Microsoft Visual Basic, yang dibangun dari ide untuk membuat bahasa yang sederhana dan mudah dalam pembuatan scriptnya (simple scripting language) untuk graphic user interface yang dikembangkan dalam sistem operasi Microsoft Windows. Visual Basic merupakan bahasa pemrograman yang sangat mudah dipelajari, dengan teknik pemrograman visual yang memungkinkan penggunanya untuk berkreasi lebih baik dalam menghasilkan suatu program, yang artinya kita dapat mendesain sendiri bagaimana tampilan program yang akan kita buat. Karena itu dalam penggunaannya Visual Basic lebih mudah digunakan. E. Hasil Praktikum

Tampilan setelah di Run

Running Led | 1

Listing Program Private Sub Command1_Click() Timer1.Enabled = True Timer2.Enabled = False If (Command1.Enabled = True) Then Timer1.Interval = 100 End If End Sub Private Sub Command2_Click() Timer1.Enabled = False Timer2.Enabled = True If (Command2.Enabled = True) Then Timer2.Interval = 100 End If End Sub Private Sub Command3_Click() Timer1.Enabled = False Timer2.Enabled = False a=0 b=0 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Private Sub Command4_Click() End End Sub Private Sub Timer1_Timer() Dim a As Integer a = Timer1.Interval Timer1.Interval = a + 100 Select Case a Case 100 Shape1(0).FillColor = vbBlue Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite

Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite End Sub

Case 200 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbBlue Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite Case 300 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbBlue Shape4.FillColor = vbWhite
Running Led | 2

Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite Case 400 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbBlue Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite Case 500 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbBlue Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite Case 600 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite Shape6.FillColor = vbBlue Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite Private Sub Timer2_Timer() Dim b As Integer b = Timer2.Interval Timer2.Interval = b + 100 Select Case b Case 100 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite

Case 700 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbBlue Shape8.FillColor = vbWhite Case 800 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbBlue Case 900 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbWhite a=0 Timer1.Interval = 100 End Select End Sub Shape5.FillColor = vbWhite Shape6.FillColor = vbWhite Shape7.FillColor = vbWhite Shape8.FillColor = vbBlue Case 200 Shape1(0).FillColor = vbWhite Shape2.FillColor = vbWhite Shape3.FillColor = vbWhite Shape4.FillColor = vbWhite Shape5.FillColor = vbWhite
Running Led | 3

Shape6.FillColor = vbWhite Shape2.FillColor = vbWhite Shape7.FillColor = vbBlue Shape3.FillColor = vbWhite Shape8.FillColor = vbWhite Shape4.FillColor = vbWhite Case 300 Shape5.FillColor = vbWhite Shape1(0).FillColor = vbWhite Shape6.FillColor = vbBlue Shape7.FillColor = vbWhite Shape4.FillColor = vbBlue Shape8.FillColor = vbWhite Shape5.FillColor = vbWhite Case 400 Shape6.FillColor = vbWhite Shape1(0).FillColor = vbWhite Shape7.FillColor = vbWhite Shape2.FillColor = vbWhite Shape8.FillColor = vbWhite Shape3.FillColor = vbWhite Case 600 Shape4.FillColor = vbWhite Shape1(0).FillColor = vbWhite Shape5.FillColor = vbBlue Shape2.FillColor = vbWhite Shape6.FillColor = vbWhite Shape3.FillColor = vbBlue Shape7.FillColor = vbWhite Shape4.FillColor = vbWhite Shape8.FillColor = vbWhite Shape5.FillColor = vbWhite Case 500 Shape6.FillColor = vbWhite Shape1(0).FillColor = vbWhite Shape7.FillColor = vbWhite Shape2.FillColor = vbWhite Shape8.FillColor = vbWhite Shape3.FillColor = vbWhite Case 700 Shape7.FillColor = vbWhite Shape1(0).FillColor = vbWhite Shape8.FillColor = vbWhite Shape2.FillColor = vbBlue Case 900 Shape3.FillColor = vbWhite Shape1(0).FillColor = vbWhite Shape4.FillColor = vbWhite Shape2.FillColor = vbWhite Shape5.FillColor = vbWhite Shape3.FillColor = vbWhite Shape6.FillColor = vbWhite Shape4.FillColor = vbWhite Shape7.FillColor = vbWhite Shape5.FillColor = vbWhite Shape8.FillColor = vbWhite Shape6.FillColor = vbWhite Case 800 Shape7.FillColor = vbWhite Shape1(0).FillColor = vbBlue Shape8.FillColor = vbWhite Shape2.FillColor = vbWhite b=0 Shape3.FillColor = vbWhite Timer2.Interval = 100 Shape4.FillColor = vbWhite End Select Shape5.FillColor = vbWhite End Sub Shape6.FillColor = vbWhite F. Kesimpulan dan Saran Dalam menggunakan visual basic ini, kita dapat mendesain program sesuai dengan keinginan. Untuk membuat simulasi Running Led dalam praktek kali ini bisa menggunakan shape, label, frame, dan command. Setelah itu, kita dapat mengatur sendiri warna dan bentuk sesuai kebutuhan.
Running Led | 4