Daftar Pustaka [1]
-----. Definition of A Robot. Tersedia di http://www.dira.dk/pdf/robotdef.pdf.
[2]
-----. Robot. Tersedia di http://en.wikipedia.org/wiki/Robot. Modifikasi terakhir 08:36, 12 Agustus 2007.
[3]
-----. Indonesia Ciptakan Robot Penjinak Bom. Tersedia di http://www.suaramerdeka.com/cybernews/harian/0605/23/nas22.htm. Selasa, 23 Mei 2006 : 21.43 WIB.
[4]
-----. Mobile Robot. Tersedia di http://en.wikipedia.org/wiki/Mobile_robot. Modifikasi terakhir 15:55, 24 Juli 2007.
[5]
Miles, P. dan Carroll, T. 2002. Build Your Own Combat Robot. McGrawHill/Osborne, USA.
[6]
-----. Parallel Port. Tersedia di http://en.wikipedia.org/wiki/Parallel_port. Modifikasi terakhir 20:35, 27 Juli 2007.
[7]
-----. Parallel Port Configuration. Tersedia di http://www.geocities.com/nozomsite/parallel.htm. 13 Agustus 2007.
[8]
Tyson, J. Parallel Port Basics. Tersedia di http://computer.howstuffworks.com/parallel-port1.htm. 13 Agustus 2007.
[9]
Engdahl, T. Parallel Port Interfacing Made Easy. Tersedia di http://www.epanorama.net/circuits/parallel_output.html. 13 Agustus 2007.
[10] Keiner, L. Electromagnetic Spectrum. Tersedia di http://en.wikipedia.org/wiki/Image:Electromagnetic-Spectrum.png. Modifikasi terakhir 23:26, 1 April 2007. [11] -----. Amplitude Shift Keying and Frequency Shift Keying. Tersedia di www.ele.uri.edu/Courses/ele436/labs/ASKnFSK.pdf. 13 Agustus 2007. [12] Datasheet RLP/TLP434. Laipac Technology, Inc. Ontario, Canada. [13] MacKenzie, I. 1995. The 8051 Microcontroller, 2nd Ed. Prentice-Hall, Inc., Englewood Cliffs, New Jersey, USA. [14] Datasheet AT89S52. 8-bit Microcontroller with 8K Bytes In-System Programmable Flash. Atmel Corporation, 2001. [15] Stewart, James W. dan Miao, Kai X. 1999. The 8051 Microcontroller: Hardware, Software, and Interfacing, 2nd Ed. Prentice-Hall, Inc., Upper Saddle River, New Jersey, USA.
44
[16] -----. Definisi Traksi. Tersedia di http://www.science.org.au/nova/080/080glo.htm, Desember 2003. [17] Datasheet HT12E. 212 Series of Encoders. Holtek Semiconductors Inc., Taiwan, Republic of China, 2000. [18] Datasheet HT12D. 212 Series of Decoders. Holtek Semiconductors Inc., Taiwan, Republic of China, 1999. [19] Budiharto, Widodo. Tanpa Tahun. Pengembangan Kendali Robot Multiguna Menggunakan Wireless. Universitas Bina Nusantara. [20] -----. Computer Vision Definition. Tersedia di http://www.definethat.com/define/3915.htm, 2003. [21] -----. RGB Color Model. Tersedia di http://en.wikipedia.org/wiki/RGB. Modifikasi terakhir 15:58, 20 Agustus 2007. [22] -----. Grayscale. Tersedia di http://en.wikipedia.org/wiki/Grayscale, modifikasi terakhir 16:35, 9 Agustus 2007. [23] Basuki, A., Palandi, J.F., dan Fatchurrochman. 2005. Pengolahan Citra Menggunakan Visual Basic. Graha Ilmu, Yogyakarta, Indonesia. [24] -----. Binary Image. Tersedia di http://en.wikipedia.org/wiki/Binary_image, modifikasi terakhir 22:17, 13 Agustus 2007. [25] -----. Wireless Camera and Receiver RC100A+208CWA. Tersedia di http://www.onetrade.biz/ot/review.asp?funcb=194677, diakses pada 19:51, 26 Agustus 2007. [26] Datasheet KA78XX/KA78XXA. 3-Terminal 1A Positive Voltage Regulator. Fairchild Semiconductor Corp., 2001. [27] Datasheet L293D/L293DD. Push-pull Four Channel Driver with Diodes. STMicroelectronics, 2003.
45
Lampiran 1. Program pada mikrokontroller #include
/* Author : Harri Sapto Wijaya (10203017) ** MCU : AT89S52 ** clock : 12/11.0592 MHz = 1.08507 usec ** compiler : Small Device C Compiler (SDCC) v2 */ #define #define #define #define #define #define
mL1 mL2 mR1 mR2 mC1 mC2
#define senFr #define senRe
P2_0 P2_1 P2_2 P2_3 P2_4 P2_5 P2_7 P2_6
char id_cmd=0x00, beres=0x01; void void void void void void void void void void
maju(); mundur(); kiri(); kanan(); stopMot(); kamUp(); kamDown(); stopKam(); delay(char msec); eksekusi(char id_cmd);
void init() { EX0 = 1; // interupsi ext0 IT0 = 1; // falling edge EX1 = 1; IT1 = 1; EA = 1; } void bacareceiver() interrupt 0 using 1 { beres = 0; P1 = 0xFF; id_cmd = P1 & 0x0F; // mask for low nibble } void menabrak() interrupt 2 using 1 { stopKam(); // ready for input senFr = 1; senRe = 1; if(senFr) { mundur(); delay(127); stopMot(); } if(senRe) { maju(); delay(127); stopMot(); } beres = 1; // hentikan aksi sebelumnya }
46
void main() { init(); while(1) { if(beres==0) { eksekusi(id_cmd); } } } void eksekusi(char id_cmd) { switch(id_cmd) { case 0x01:// maju maju(); break; case 0x02:// kiri 1 step kiri(); delay(100); stopMot(); break; case 0x03:// kanan 1 step kanan(); delay(100); stopMot(); break; case 0x04:// mundur mundur(); break; case 0x05:// stop motor stopMot(); break; case 0x06:// maju 1 step maju(); delay(100); stopMot(); break; case 0x07:// kiri kiri(); break; case 0x08:// kanan kanan(); break; case 0x09:// mundur 1 step mundur(); delay(100); stopMot(); break; case 0x0A:// kamera up kamUp(); break; case 0x0B:// kamera down kamDown(); break; case 0x0C:// stop kamera stopKam(); break; case 0x0D:// kamera up 1 step kamUp(); delay(100); stopKam(); break; case 0x0E:// kamera down 1 step kamDown(); delay(100); stopKam(); break; } beres = 1; } void maju() {
47
mL1 = 1; mL2 = 0; mR1 = 1; mR2 = 0; } void mundur() { mL1 = 0; mL2 = 1; mR1 = 0; mR2 = 1; } void kiri() { mL1 = 0; mL2 = 1; mR1 = 1; mR2 = 0; } void kanan() { mL1 = 1; mL2 = 0; mR1 = 0; mR2 = 1; } void stopMot() { mL1 = 1; mL2 = 1; mR1 = 1; mR2 = 1; } void kamUp() { mC1 = 1; mC2 = 0; } void kamDown() { mC1 = 0; mC2 = 1; } void stopKam() { mC1 = 1; mC2 = 1; } void delay(char msec) { char j; int i; for(j=0; j<msec; j++) for(i=0; i<200; i++); }
2. Program kendali manual Module1.bas Fungsi: Mendefinisikan variabel dan fungsi global. Public Declare As Integer) As Public Declare Integer, ByVal Public Declare
Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress Integer Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Value As Integer) Sub Tunda Lib "Port_IO.dll" (ByVal lama As Integer)
Private Declare Function SetWindowPos Lib "user32" _ (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, _ ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Const Const Const Const
HWND_TOPMOST = -1 HWND_NOTOPMOST = -2 SWP_NOMOVE = &H2 SWP_NOSIZE = &H1
Public Function PutWindowOnTop(pFrm As Form, pilih As Integer) Dim lngWindowPosition As Long
48
If pilih = 0 Then lngWindowPosition = SetWindowPos(pFrm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) ElseIf pilih = 1 Then lngWindowPosition = SetWindowPos(pFrm.hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE) End If End Function
Form1 Fungsi: Antar muka utama, untuk pengendalian manual (menangani event tekan tombol). Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim i As Integer, j As Integer Beep Select Case KeyCode Case vbKeyUp If Shift Then maju1step Else maju End If Case vbKeyLeft If Shift Then kiri Else kiri1step End If Case vbKeyRight If Shift Then kanan Else kanan1step End If Case vbKeyDown If Shift Then mundur1step Else mundur End If Case vbKeyEnd stopMot Case vbKeyPageUp If Shift Then kamUp Else kamUp1step End If Case vbKeyPageDown If Shift Then kamDown Else kamDown1step End If Case vbKeyHome kamStop Case vbKeySpace '// snapshoot Form2.CommonDialog1.Filter = "gambar bitmap (*.bmp)|*.bmp" Form2.CommonDialog1.CancelError = True On Error GoTo keluar2: Form2.CommonDialog1.ShowSave If Form2.CommonDialog1.FileName <> "" Then Form2.VideoCap1.SnapShot (Form2.CommonDialog1.FileName) End If End Select keluar2: End Sub
49
Sub maju() Out Val("&H" + Str(378)), 1 + 16 Out Val("&H" + Str(378)), 1 Tunda (100) Out Val("&H" + Str(378)), 1 + 16 End Sub Sub kiri1step() Out Val("&H" + Str(378)), 2 + 16 Out Val("&H" + Str(378)), 2 Tunda (100) Out Val("&H" + Str(378)), 2 + 16 End Sub Sub kanan1step() Out Val("&H" + Str(378)), 3 + 16 Out Val("&H" + Str(378)), 3 Tunda (100) Out Val("&H" + Str(378)), 3 + 16 End Sub Sub mundur() Out Val("&H" + Str(378)), 4 + 16 Out Val("&H" + Str(378)), 4 Tunda (100) Out Val("&H" + Str(378)), 4 + 16 End Sub Sub stopMot() Out Val("&H" + Str(378)), 5 + 16 Out Val("&H" + Str(378)), 5 Tunda (100) Out Val("&H" + Str(378)), 5 + 16 End Sub Sub maju1step() Out Val("&H" + Str(378)), 6 + 16 Out Val("&H" + Str(378)), 6 Tunda (100) Out Val("&H" + Str(378)), 6 + 16 End Sub Sub kiri() Out Val("&H" + Str(378)), 7 + 16 Out Val("&H" + Str(378)), 7 Tunda (100) Out Val("&H" + Str(378)), 7 + 16 End Sub Sub kanan() Out Val("&H" + Str(378)), 8 + 16 Out Val("&H" + Str(378)), 8 Tunda (100) Out Val("&H" + Str(378)), 8 + 16 End Sub Sub mundur1step() Out Val("&H" + Str(378)), 9 + 16 Out Val("&H" + Str(378)), 9 Tunda (100) Out Val("&H" + Str(378)), 9 + 16 End Sub Sub kamUp() Out Val("&H" + Str(378)), 10 + 16 Out Val("&H" + Str(378)), 10 Tunda (100) Out Val("&H" + Str(378)), 10 + 16 End Sub Sub kamDown() Out Val("&H" + Str(378)), 11 + 16 Out Val("&H" + Str(378)), 11 Tunda (100) Out Val("&H" + Str(378)), 11 + 16 End Sub
50
Sub kamStop() Out Val("&H" + Str(378)), 12 + 16 Out Val("&H" + Str(378)), 12 Tunda (100) Out Val("&H" + Str(378)), 12 + 16 End Sub Sub kamUp1step() Out Val("&H" + Str(378)), 13 + 16 Out Val("&H" + Str(378)), 13 Tunda (100) Out Val("&H" + Str(378)), 13 + 16 End Sub Sub kamDown1step() Out Val("&H" + Str(378)), 14 + 16 Out Val("&H" + Str(378)), 14 Tunda (100) Out Val("&H" + Str(378)), 14 + 16 End Sub Private Sub Form_Load() Call PutWindowOnTop(Me, 0) End Sub Private Sub Form_Unload(Cancel As Integer) Unload Form2 End Sub Private Sub mnuVideo_Click() Load Form2 Form2.Show vbModeless End Sub
Form2 Fungsi: Menampilkan tampilan kamera. Private Sub Form_Load() Shape1.BackStyle = 0 lblStatusVideo.Caption = "offline" VideoCap1_Click End Sub Private Sub VideoCap1_Click() Static bolKlik As Boolean If bolKlik = False Then bolKlik = True Shape1.BackColor = vbRed Shape1.BackStyle = 1 lblStatusVideo.Caption = "loading..." VideoCap1.Start VideoCap1.VideoInput = 1 '// v-composite VideoCap1.Start Shape1.BackColor = vbGreen lblStatusVideo.Caption = "online" Else bolKlik = False Shape1.BackStyle = 0 lblStatusVideo.Caption = "offline" VideoCap1.Stop End If End Sub
3. Program pengikut garis Menggunakan Visual Basic 6 Module1.bas
51
Fungsi: Mendeklarasikan fungsi pengaksesan port parallel Public Declare As Integer) As Public Declare Integer, ByVal Public Declare
Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress Integer Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Value As Integer) Sub Tunda Lib "Port_IO.dll" (ByVal lama As Integer)
Form1 Fungsi: Menampilkan hasil pengolahan gambar dan mengirimkan instruksi ke robot. Option Explicit Dim Dim Dim Dim
i As Integer, j As Integer warna As Double r As Integer, g As Integer, b As Integer grey As Integer
Private Sub Form_Load() VideoCap1.Start VideoCap1.VideoInput = 1 ' Video Composite VideoCap1.Start End Sub Sub greyscale() '// For i = 1 To Picture1.ScaleWidth Step 15 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) g = Int((warna And RGB(0, 255, 0)) / 256) b = Int(Int((warna And RGB(0, 0, 255)) / 256) / 256) grey = (42 * r + 32 * g + 28 * b) / 100 Picture1.PSet (i, j), RGB(grey, grey, grey) Next j Next i End Sub Sub binaryimage() '// For i = 1 To Picture1.ScaleWidth Step 15 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) g = Int((warna And RGB(0, 255, 0)) / 256) b = Int(Int((warna And RGB(0, 0, 255)) / 256) / 256) grey = (42 * r + 32 * g + 28 * b) / 100 If grey < 128 Then grey = 0 Else grey = 255 ' 0 : hitam Picture1.PSet (i, j), RGB(grey, grey, grey) Next j Next i End Sub Sub centerscreen() '// For j = 1 To Picture1.ScaleHeight Step 15 Picture1.PSet (Picture1.ScaleWidth / 2, j), RGB(0, 255, 0) Next j End Sub Function kananataukiri() Dim mkiri As Integer, mkanan As Integer Dim skalaL As Integer, skalaR As Integer '// skalaL = 0 For i = 1 To Picture1.ScaleWidth / 2 Step 15 mkiri = 0 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) g = Int((warna And RGB(0, 255, 0)) / 256) b = Int(Int((warna And RGB(0, 0, 255)) / 256) / 256) If r = 0 And g = 0 And b = 0 Then mkiri = mkiri + 1
52
Next j skalaL = skalaL + mkiri Next i '// skalaR = 0 For i = Picture1.ScaleWidth / 2 To Picture1.ScaleWidth Step 15 mkanan = 0 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) g = Int((warna And RGB(0, 255, 0)) / 256) b = Int(Int((warna And RGB(0, 0, 255)) / 256) / 256) If r = 0 And g = 0 And b = 0 Then mkanan = mkanan + 1 Next j skalaR = skalaR + mkanan Next i Form1.Label1.Caption = "kiri " & Str(skalaL) & ", " & "kanan " & Str(skalaR) If skalaL - skalaR > 100 Then kananataukiri = 0 '// kiri ElseIf skalaR - skalaL > 100 Then kananataukiri = 1 '// kanan Else kananataukiri = 2 '// maju saja End If End Function Private Dim Dim Dim
Sub Timer1_Timer() strFileName As String hasil As Boolean kanankiri As Integer
strFileName = App.Path + "\" + "snapshoot" + ".bmp" hasil = VideoCap1.SnapShot(strFileName) Picture1.Picture = LoadPicture(strFileName, vbLPLarge, vbLPColor) greyscale binaryimage centerscreen kanankiri = kananataukiri() If kanankiri = 0 Then '// kiri1step Out Val("&H" + Str(378)), 2 + 16 Out Val("&H" + Str(378)), 2 Tunda (100) Out Val("&H" + Str(378)), 2 + 16 ElseIf kanankiri = '// kanan1step Out Val("&H" + Out Val("&H" + Tunda (100) Out Val("&H" +
1 Then Str(378)), 3 + 16 Str(378)), 3 Str(378)), 3 + 16
End If Tunda (100) Tunda (100) '// maju1step Out Val("&H" + Str(378)), 6 + 16 Out Val("&H" + Str(378)), 6 Tunda (100) Out Val("&H" + Str(378)), 6 + 16 Tunda (100) End Sub
4. Program pengikut bola merah Menggunakan Visual Basic 6
53
Module1.bas Fungsi: Mendeklarasikan fungsi pengaksesan port parallel. Public Declare As Integer) As Public Declare Integer, ByVal Public Declare
Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress Integer Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Value As Integer) Sub Tunda Lib "Port_IO.dll" (ByVal lama As Integer)
frmMain Fungsi: Melakukan pemrosesan gambar dan mengirim instruksi ke robot. Option Explicit Dim nilaiwarna As Long Dim toleransi As Long Private Sub Command1_Click() Static statusnya As Boolean If statusnya = False Then Command1.Caption = "Loading..." VideoCap1.Start '// input 0 : TV tuner VideoCap1.VideoInput = 1 '// input 1 : video composite VideoCap1.Start statusnya = True Command1.Caption = "Stop" Timer1.Enabled = True Else statusnya = False Timer1.Enabled = False VideoCap1.Stop Command1.Caption = "Mulai" End If End Sub Private Sub Form_Load() Timer1.Enabled = False End Sub Private Sub Timer1_Timer() ambilgambar filtermerah '// pusat screen + pusat merah + gerakkan pusatmerah End Sub Sub ambilgambar() Dim strNamaFile As String Dim hasil As Boolean '// tambahan untuk analisis saja 'Static cacah As Integer ' 'strNamaFile = App.Path + "\" + "snapshoot" + Str(cacah) + ".bmp" 'hasil = VideoCap1.SnapShot(strNamaFile) 'cacah = cacah + 1 '// end tambahan strNamaFile = App.Path + "\" + "snapshoot" + ".bmp" hasil = VideoCap1.SnapShot(strNamaFile) Picture1.Picture = LoadPicture(strNamaFile, vbLPLarge, vbLPColor) End Sub Sub filterbayangan() '// Dim i As Integer, j As Integer Dim r As Integer, g As Integer, b As Integer Dim warna As Long ' 4 byte nilaiwarna = RGB(32, 59, 61) toleransi = 1000000 '2000000
54
For i = 1 To Picture1.ScaleWidth Step 15 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) g = Int((warna And RGB(0, 255, 0)) / 256) b = Int(Int((warna And RGB(0, 0, 255)) / 256) / 256) If warna < nilaiwarna - toleransi Or warna > nilaiwarna + toleransi Then Picture1.PSet (i, j), RGB(0, 0, 0) Else Picture1.PSet (i, j), RGB(r, g, b) End If Next j Next i End Sub Sub filtermerah() '// Dim i As Integer, j As Integer Dim r As Integer, g As Integer, b As Integer Dim warna As Long ' 4 byte For i = 1 To Picture1.ScaleWidth Step 15 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) g = Int((warna And RGB(0, 255, 0)) / 256) b = Int(Int((warna And RGB(0, 0, 255)) / 256) / 256) If (r >= 130) And (g <= 90) And (b <= 90) Then Picture1.PSet (i, j), RGB(255, 0, 0) Else Picture1.PSet (i, j), RGB(0, 0, 0) End If Next j Next i End Sub Sub pusatmerah() On Error GoTo kensel: '// Dim Dim Dim
pusat screen i As Integer, j As Integer r As Integer, g As Integer, b As Integer warna As Long ' 4 byte
Dim totalwarna As Long, mx As Long, my As Long Dim xcm As Long, ycm As Long For i = 1 To Picture1.ScaleWidth Step 15 For j = 1 To Picture1.ScaleHeight Step 15 Picture1.PSet (Picture1.ScaleWidth / 2, j), RGB(0, 255, 0) Next j Picture1.PSet (i, Picture1.ScaleHeight / 2), RGB(0, 255, 0) Next i '// CARI PUSAT WARNA '// cari massa warna totalwarna = 0 For i = 1 To Picture1.ScaleWidth Step 15 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) If r = 255 Then totalwarna = totalwarna + 1 Next j Next i '// di bawah 500, jangan deteksi sebagai merah Label2.Caption = "Total pixel merah : " & Str(totalwarna) If totalwarna = 0 Then Label3.Caption = "Eh, koq ngeblank." + vbCrLf + "Kameranya mati ya ?" Picture2.Picture = LoadPicture(App.Path + "\mukasewot.bmp") GoTo keluar2 End If
55
If totalwarna < 500 Then GoTo tidakterdeteksi '// hitung pusat massa warna arah x xcm = 0 For i = 1 To Picture1.ScaleWidth Step 15 mx = 0 For j = 1 To Picture1.ScaleHeight Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) If r = 255 Then mx = mx + 1 Next j xcm = xcm + mx * i Next i xcm = xcm / totalwarna '// hitung pusat massa warna arah y ycm = 0 For j = 1 To Picture1.ScaleHeight Step 15 my = 0 For i = 1 To Picture1.ScaleWidth Step 15 warna = Picture1.Point(i, j) r = warna And RGB(255, 0, 0) If r = 255 Then my = my + 1 Next i ycm = ycm + my * j Next j ycm = ycm / totalwarna '// beri tanda For i = 1 To Picture1.ScaleWidth Step 15 Picture1.PSet (i, ycm), RGB(255, 0, 0) Next i For j = 1 To Picture1.ScaleHeight Step 15 Picture1.PSet (xcm, j), RGB(255, 0, 0) Next j
'// GERAKKAN ' ok tidak ada error Label1.Caption = "" ' region 1 (0 <= xcm < 1/3*w, 0 <= ycm < 1/3*h) If (ycm >= 0) And (ycm < 1 / 3 * Picture1.ScaleHeight) Then If (xcm >= 0) And (xcm < 1 / 3 * Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") kiri1step kiri1step kiri1step maju1step maju1step maju1step maju1step maju1step maju1step maju1step ' region 2 (1/3*w <= xcm < 2/3*w, 0 <= ycm < 1/3*h) ElseIf (xcm >= 1 / 3 * Picture1.ScaleWidth) And (xcm < 2 / 3 * Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") maju1step maju1step maju1step maju1step maju1step maju1step maju1step ' region 3 (2/3*w <= xcm < w, 0 <= ycm < 1/3*h) ElseIf (xcm >= 2 / 3 * Picture1.ScaleWidth) And (xcm < Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") kanan1step kanan1step kanan1step maju1step
56
maju1step maju1step maju1step maju1step maju1step maju1step End If ' region 4 (0 <= xcm < 1/3*w, 1/3*h <= ycm < 2/3*h) ElseIf (ycm >= 1 / 3 * Picture1.ScaleHeight) And (ycm < 2 / 3 * Picture1.ScaleHeight) Then If (xcm >= 0) And (xcm < 1 / 3 * Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") kiri1step kiri1step kiri1step maju1step maju1step ' region 5 (1/3*w <= xcm < 2/3*w, 1/3*h <= ycm < 2/3*h) ElseIf (xcm >= 1 / 3 * Picture1.ScaleWidth) And (xcm < 2 / 3 * Picture1.ScaleWidth) Then '// no action Label3.Caption = "HOREE... Bola merah!!" Picture2.Picture = LoadPicture(App.Path + "\mukasenang2.bmp") kanan1step kiri1step kanan1step kiri1step 'kamUp1step 'kamDown1step 'kamDown1step 'kamUp1step Label2.Caption = "Total pixel merah : " & Str(totalwarna) ' region 6 (2/3*w <= xcm < w, 1/3*h <= ycm < 2/3*h) ElseIf (xcm >= 2 / 3 * Picture1.ScaleWidth) And (xcm < Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") kanan1step kanan1step kanan1step maju1step maju1step End If ' region 7 (0 <= xcm < 1/3*w, 2/3*h <= ycm < h) ElseIf (ycm >= 2 / 3 * Picture1.ScaleHeight) And (ycm < Picture1.ScaleHeight) Then If (xcm >= 0) And (xcm < 1 / 3 * Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") kiri1step kiri1step kiri1step mundur1step mundur1step ' region 8 (1/3*w <= xcm < 2/3*w, 2/3*h <= ycm < h) ElseIf (xcm >= 1 / 3 * Picture1.ScaleWidth) And (xcm < 2 / 3 * Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") mundur1step mundur1step mundur1step ' region 9 (2/3*w <= xcm < 2/3*w, 2/3*h <= ycm < h) ElseIf (xcm >= 2 / 3 * Picture1.ScaleWidth) And (xcm < Picture1.ScaleWidth) Then Label3.Caption = "Itu bolanya!" Picture2.Picture = LoadPicture(App.Path + "\mukagembira2.bmp") kanan1step kanan1step kanan1step mundur1step mundur1step End If End If keluar1:
57
GoTo keluar2 tidakterdeteksi: Label2.Caption = Label3.Caption = Picture2.Picture GoTo keluar2 kensel: Label1.Caption = keluar2: End Sub
"Total pixel merah : " & Str(totalwarna) "Uh, mana ya bola merahnya ?" = LoadPicture(App.Path + "\mukasedih2.bmp")
"error!"
Sub maju1step() '// Out Val("&H" + Str(378)), 6 + 16 Out Val("&H" + Str(378)), 6 Tunda (100) Out Val("&H" + Str(378)), 6 + 16 Tunda (100) End Sub Sub mundur1step() '// Out Val("&H" + Str(378)), 9 + 16 Out Val("&H" + Str(378)), 9 Tunda (100) Out Val("&H" + Str(378)), 9 + 16 Tunda (100) End Sub Sub kiri1step() '// Out Val("&H" + Str(378)), 2 + 16 Out Val("&H" + Str(378)), 2 Tunda (100) Out Val("&H" + Str(378)), 2 + 16 Tunda (100) End Sub Sub kanan1step() '// Out Val("&H" + Str(378)), 3 + 16 Out Val("&H" + Str(378)), 3 Tunda (100) Out Val("&H" + Str(378)), 3 + 16 Tunda (100) End Sub Sub kamUp1step() Out Val("&H" + Str(378)), 13 + 16 Out Val("&H" + Str(378)), 13 Tunda (100) Out Val("&H" + Str(378)), 13 + 16 End Sub Sub kamDown1step() Out Val("&H" + Str(378)), 14 + 16 Out Val("&H" + Str(378)), 14 Tunda (100) Out Val("&H" + Str(378)), 14 + 16 End Sub
58
Riwayat Hidup Harri Sapto Wijaya, lahir di Sumedang, Jawa Barat, pada 28
September 1985. Setelah menyelesaikan pendidikan dasar di SDN Conggeang IV, SLTPN 1 Conggeang, dan SMUN 1 Sumedang pada tahun 2003, ia melanjutkan ke Departemen Fisika, Institut Teknologi Bandung. Kelompok keahlian yang diambilnya ialah Elektronika dan Instrumentasi, di bawah Theoritical High Energy Physics and Instrumentation Reseach Group. Semasa di SMU, ia pernah mengikuti Olimpiade Fisika Nasional dan Training Tim Olimpiade Fisika Indonesia di Universitas Pelita Harapan, Karawaci, Tangerang, pada tahun 2002. Beberapa paper yang pernah ditulis selama menjadi mahasiswa di Fisika ITB ialah sebagai berikut. 1. Harri Sapto Wijaya, Aunuddin Syabba Vioktalamo. Penentuan Indeks Bias Titik-titik Air di Atmosfer untuk Berbagai Panjang Gelombang Cahaya Tampak Melalui Pengamatan Pelangi. Simposium Nasional Mahasiswa Fisika Indonesia, HIMASIKA, Institut Teknologi Sepuluh November Surabaya (ITS), Indonesia, 2005. 2. Harri Sapto Wijaya. Pencarian Jalur Terpendek Menggunakan Algoritma A-star. Indonesian Physics Seminar and Symposium, NAWAKSARA, HIMAFI, Institut Teknologi Bandung (ITB), 2006. 3. Harri Sapto Wijaya, Mitra Djamal. Automatic Door using Voice Recognition base on Momentum Back Propagation and Cross Correlation Method. International Conference on Instrumentation, Communication, and Information Technology (ICICI). Theoritical High Energy Physics and Instrumentation Research Group, FMIPA, ITB, 2007.
Saat menjadi mahasiswa, pernah menjadi Koordinator Asisten untuk Praktikum Elektronika di Lab Elektronika dan Instrumentasi. Juga pernah terlibat dalam riset pengembangan mobile robot dengan dana dari PHK-B Fisika ITB dan PKM DIKTI. Dapat dihubungi melalui: [email protected].
59