LAMPIRAN. Universitas Sumatera Utara

Similar documents
LAMPIRAN LIST PROGRAM

Tutorial, Source code, Request Program Visual Basic

LISTING PROGRAM. 1. Form Login. Private Sub BATAL_Click() End End Sub

Alexandria University Faculty of Engineering Communications & Electronics Department.

LAMPIRAN : LISTING PROGRAM

LISTING PROGRAM. 1. Form Menu Utama. Universitas Sumatera Utara

LISTING PROGRAM. Form Splash

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue

LAMPIRAN A LISTING PROGRAM. Universitas Sumatera Utara

Introduction To MCS-51

2. Write an 8051 program to generate a square wave of 25 khz at pin P2.3 using XTAL = 12 MHz. Solution:

LAMPIRAN. Universitas Sumatera Utara

An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is

IS1U60 IS1U60L Recommended operating conditions. Unit

L A M P I R A N. Universitas Sumatera Utara

LAMPIRAN FORM 1 Universitas Sumatera Universitas Utara

LAMPIRAN A : LISTING PROGRAM

LAMPIRAN 1. Kode Program Splash Screen

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

LAMPIRAN A PROGRAM ADMINISTRASI

End Sub. Sub Kunci() Dim i As Integer For i = 0 To 4 Txtfield(i).Locked = True Next i grddatagrid.enabled = False End Sub

FACULTY OF ENGINEERING LAB SHEET

MCS-51 Serial Port A T 8 9 C 5 2 1

1. Pin diagram of 8051 and ports

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Programming in Assembly Module No: CS/ES/12 Quadrant 1 e-text

8051 Timers and Serial Port

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.

8051 Serial Port. EE4380 Fall02 Class 10. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

INTERRUPTS PROGRAMMING

1. Menu Utama. Private Sub abt_click() frmabout.show End Sub. Private Sub dafabsenhar_click() frmdafabsensihar.show End Sub

Assembly Language programming (3)

CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts

LISTING PROGRAM. 1. Menu Utama

Microcontroller and Embedded Systems:

ELEG3923 Microprocessor Ch.9 Timer Programming

LISTING PROGRAM. 1. Tampilan Awal. 2. Menu Login. Public Class Awal

Chapter 6 Interrupts. (I. Scott Mackenzie) By: Masud-ul-Hasan

FlashFlex51 Microcontroller Control of CompactFlash Card in TrueIDE Mode

Interfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman


ต วอย างการสร างฟอร ม เมน การใช งาน

Megawin 8051 ISP via COM Port

Chapter Family Microcontrollers Instruction Set

MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM

Lookup Project. frmlookup (Name: object is a combo box, style 2); use 4 labels: 2 for phone, 2 for mail. MsgBox Function:

ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458

Microcontroller Intel [Instruction Set]

LAMPIRAN A : LISTING PROGRAM

Listing Progam. Universitas Sumatera Utara

Appendix A Cable Pinouts

Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports.

Microcontroller and Applications

LAMPIRAN A LISTING PROGRAM

Understanding the MsgBox command in Visual Basic

Lampiran 2 MASTER TABEL

Cable Pinouts. SRP I/O Module

LISTING PROGRAM. Source Code Tampilan Awal. Source Code Menu Utama

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

CoE3DJ4 Digital Systems Design. Chapter 5: Serial Port Operation

DS89C450-KIT# DS89C450 Evaluation Kit

8051 Timers. Class 7 EE4380 Fall Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

Application Brief D-005

Document: Datasheet Date: 22-Mar-11 Model #: 3679 Product s Page:

Digital Blocks Semiconductor IP

EX KVIS RS232/422/485 3-in-1 Serial to USB Adapter (w/ 4KV Isolation, 15KV ESD Surge Protection)

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

Digital Blocks Semiconductor IP

EZL-200F Application Notes (003) Serial Interface (RS232/RS422/RS485)


LISTING PROGRAM. PrivateSub KeluarToolStripMenuItem_Click(sender AsObject, e AsEventArgs) Handles KeluarToolStripMenuItem.Click Close() EndSub

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

Chapter 09. Programming in Assembly

PCIe Card Selection Guide. PCIe-CAN Card. PCIe-COM Card. Taiwan Pulse Motion Co.,Ltd. Bus Interface PCI Express x 1 LPE-C122 PCE-C122D PCE-C122T

Interrupt Programming: Interrupts vs. Polling Method:

Programming of 8085 microprocessor and 8051 micro controller Study material

AVR-Ready1. Additional Board. Manual. MikroElektronika

Embedded Controller Programming

AVR-Ready2. Additional Board. Manual. MikroElektronika

build_char macro P1,P2,P3,P4,P5,P6,P7,P8 ;Macro for building a custom character

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

ELEG3923 Microprocessor Ch.10 Serial Port Programming

BLE232: Manual Copyright 2014 taskit GmbH

LISTING PROGRAM. 1. Menu Utama

ELEG3923 Microprocessor Ch.4 I/O Ports

8051 Microcontroller

CPEG300 Embedded System Design. Lecture 8 Timer

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

ELEG3924 Microprocessor

Dodatak. Skup instrukcija

Mod-3: Interrupts,Timer operation,serial communication 1

8-bit Microcontroller with 2/4-Kbyte Flash AT89LP2052 AT89LP4052

LAMPIRAN A : LISTING PROGRAM

EX & EX-45362IS 2S RS232/422/485 3-in-1 Serial PCIe Card

APPLICATION NOTE 600 Ultra High Speed Microcontroller Hardware Enhances Serial Port Capability

Chapter 3. Bit Addressable Area. By DeccanRobots

LISTING PROGRAM. mainform.vb A-1. Universitas Sumatera Utara

LCD AND KEYBOARD INTERFACING

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

CW6631B Bluetooth Audio Player Microcontroller User Manual

Transcription:

67 LAMPIRAN

Lampiran A-1 Listing Program Visual Basic Private Sub mn_isidata_click() frm_isi_data.show Me.Hide Private Sub mn_koneksiport_click() frm_koneksi_port.show Me.Hide Private Sub mn_tentang_click() frm_tentang.show Me.Hide Private Sub mn_keluar_click() End Sub Clear() txt_no.text = "" txt_nama.text = "" cbo_jenkel.text = "" lbl_tinggi_badan.caption = "0" Call buat_id Sub buat_id() Call BukaDatabase Set Rs_data = New ADODB.Recordset

Lampiran A-2 Rs_data.Open "SELECT * FROM tbl_isi_data", KonekDb, adopendynamic, adlockoptimistic If Rs_data.PageCount > 0 Then With Rs_data.MoveLast On Error Resume Next txt_no.text =!id + 1 End With Else txt_no.text = 1 End If Private Sub dg_data_click() GridBaris = dg_data.row Set Rs_data = New ADODB.Recordset Rs_data.Open " SELECT * FROM tbl_isi_data WHERE id='" & dg_data.textmatrix(gridbaris, 0) & "' " _, KonekDb, adopendynamic, adlockoptimistic If Rs_data.BOF Then MsgBox "TABEL MASIH KOSONG", vbokonly + vbinformation, "Perhatian" Exit Sub Call Clear Else Rs_data.MoveFirst Do While Not Rs_data.EOF On Error Resume Next txt_no.text = Rs_data!id txt_nama.text = Rs_data!nama cbo_jenkel.text = Rs_data!jenis_kelamin

Lampiran A-3 lbl_tinggi_badan.caption = Rs_data!tinggi_badan Rs_data.MoveNext Loop End If Private Sub Form_Load() cbo_jenkel.additem "Pria" cbo_jenkel.additem "Wanita" Call BukaDatabase Call tampil_data Call buat_id Private Sub cmd_batal_click() Call Clear Private Sub cmd_keluar_click() frm_utama.show Unload Me Private Sub cmd_simpan_click() Set Rs_data = New ADODB.Recordset Rs_data.Open "SELECT * FROM tbl_isi_data WHERE nama='" & txt_nama.text & "'", _ KonekDb, adopendynamic, adlockbatchoptimistic If Rs_data.BOF Then SQLsimpan = "" SQLsimpan = "INSERT INTO tbl_isi_data (id, nama, jenis_kelamin, tinggi_badan)" _

Lampiran A-4 & " VALUES(" & txt_no.text & ",'" & txt_nama.text & "','" _ & cbo_jenkel.text & "', '" & lbl_tinggi_badan.caption & "')" KonekDb.Execute SQLsimpan,, adcmdtext MsgBox "DATA BARU TELAH TERSIMPAN", vbokonly + vbinformation, "INFO" Else MsgBox "ID SUDAH ADA", vbokonly + vbinformation, "INFO" End If Rs_data.Requery Call Clear Call tampil_data Call buat_id Private Sub cmd_ubah_click() SQLubah = "UPDATE tbl_isi_data " _ & " set nama='" & txt_nama.text & "', " _ & " jenis_kelamin ='" & cbo_jenkel.text & "'," _ & " tinggi_badan ='" & lbl_tinggi_badan.caption & "'" _ & " WHERE id=" & CInt(txt_no.Text) KonekDb.Execute SQLubah,, adcmdtext MsgBox "DATA TELAH DIUBAH", vbokonly + vbinformation, "Konfirmasi" Rs_data.Requery Call Clear Call tampil_data Call buat_id

Lampiran A-5 Private Sub cmd_hapus_click() hapus = MsgBox("yakin ingin menghapus data ini?", vbquestion + vbyesno, "Hapus") If hapus = vbyes Then SQL = "DELETE FROM tbl_isi_data WHERE id='" & txt_no.text & "'" KonekDb.Execute SQL,, adcmdtext Rs_data.Requery Call Clear Call tampil_data Else Call Clear End If Call buat_id Sub Aktifdg_data() With dg_data.cols = 4.RowHeightMin = 300.Col = 0.Row = 0.Text = "ID".CellFontBold = True.ColWidth(0) = 1700.AllowUserResizing = flexresizecolumns.cellalignment = flexaligncentercenter.col = 1.Row = 0.Text = "NAMA".CellFontBold = True

Lampiran A-6.ColWidth(1) = 2500.AllowUserResizing = flexresizecolumns.cellalignment = flexaligncentercenter.col = 1.Row = 0.Text = "JENIS KELAMIN".CellFontBold = True.ColWidth(2) = 2650.AllowUserResizing = flexresizecolumns.cellalignment = flexaligncentercenter.col = 3.Row = 0.Text = "TINGGI BADAN".CellFontBold = True.ColWidth(3) = 2650.AllowUserResizing = flexresizecolumns.cellalignment = flexaligncentercenter End With Sub tampil_data() Dim Baris As Integer dg_data.clear Call Aktifdg_data dg_data.rows = 2 Baris = 0 Set Rs_data = New ADODB.Recordset Rs_data.Open "SELECT * FROM tbl_isi_data", KonekDb, adopendynamic, adlockoptimistic If Rs_data.PageCount > 0 Then

Lampiran A-7 With Rs_data.MoveFirst Do While Not.EOF On Error Resume Next Baris = Baris + 1 dg_data.rows = Baris + 1 dg_data.textmatrix(baris, 0) =!id dg_data.textmatrix(baris, 1) =!nama dg_data.textmatrix(baris, 2) =!jenis_kelamin dg_data.textmatrix(baris, 3) =!tinggi.movenext Loop End With End If Private Sub Form_Unload(Cancel As Integer) frm_utama.show Me.Hide Private Sub cmd_exit_click() Unload Me Private Sub Form_Load() cbo_bound_rate.additem "9600" cbo_comm_port.additem "COMM2" Private Sub Form_Unload(Cancel As Integer) frm_utama.show Me.Hide

Lampiran A-8 Unload Me Private Sub Form_Unload(Cancel As Integer) frm_utama.show Me.Hide Private Sub mn_keluar_click() End Option Explicit Public KonekDb As New ADODB.Connection Public Rs_data As New ADODB.Recordset Public Koneksi, Bound_Rate As String Public Port As Integer Public SQLubah, SQLsimpan, SQLhapus As String Sub BukaDatabase() Dim strss, strport, strdb, struid, strpwd As String strss = "localhost" strport = "3306" strdb = "db_mikrokontroler" struid = "root" strpwd = "" Set KonekDb = New ADODB.Connection KonekDb.CursorLocation = aduseclient KonekDb.ConnectionString = "" _ & "DRIVER={MYSQL ODBC 3.51 Driver};" _ & "SERVER=" & strss & ";" _ & "DATABASE=" & strdb & ";" _ & "UID=" & struid & ";" _ & "PWD=" & strpwd & ";" _

Lampiran A-9 & "OPTION=" On Error Resume Next If KonekDb.State = adstateopen Then KonekDb.Close Set KonekDb = New ADODB.Connection KonekDb.Open Else KonekDb.Open End If If Err.Number <> 0 Then MsgBox "GAGAL KONEKSI SERVER", vbokonly, "Kesalahan" End If

Lampiran B-1 Listing Program Mikrokontroler MOV TMOD,#20H MOV SCON,#50H MOV TH1,#-3 SETB TR1 mov p0,#0 mov 70h,#0 mov 71h,#0 mov 72h,#0 Ping: hitung: setb p1.2 acall tunda clr p1.2 acall tunda setb p1.2 acall tunda clr p1.2 acall tunda setb p1.2 nop nop nop nop clr p1.2 nop nop nop nop jb p1.3,$ mov 70h,#0 mov 71h,#0 mov 72h,#0 acall pulsa jnb p1.3,terus_hitung sjmp jarak terus_hitung:

Lampiran B-2 inc 70h mov r2,70h cjne r2,#0ah,hitung mov 70h,#0h inc 71h mov r2,71h cjne r2,#0ah,hitung mov 71h,#0h inc 72h mov r2,72h cjne r2,#0ah,hitung mov 72h,#0h ljmp hitung jarak: mov r0,70h acall transfer mov 73h,r1 mov r0,71h acall transfer mov 74h,r1 mov r0,72h acall transfer mov 75h,r1 acall tampil ljmp ping transfer: cjne r0,#0h,satu mov r1,#'0' satu: cjne r0,#01h,dua mov r1,#'1' dua: tiga: cjne r0,#02h,tiga mov r1,#'2' cjne r0,#03h,empat mov r1,#'3'

Lampiran B-3 empat: cjne r0,#04h,lima mov r1,#'4' lima: cjne r0,#05h,enam mov r1,#'5' enam: cjne r0,#06h,tujuh mov r1,#'6' tujuh: cjne r0,#07h,delapan mov r1,#'7' delapan: cjne r0,#08h,sembilan mov r1,#'8' sembilan: cjne r0,#09h,transfer mov r1,#'9' tampil: tunda: tnd: mov sbuf,75h jnb ti,$ clr ti mov sbuf,74h jnb ti,$ clr ti mov sbuf,73h jnb ti,$ clr ti acall tunda cpl p3.7 mov r7,#255 mov r6,#255 djnz r6,$

Lampiran B-4 djnz r7,tnd tunda1: tnd1: pulsa: mov r7,#10 mov r6,#255 djnz r6,$ djnz r7,tnd1 mov r7,#23 djnz r7,$

Tx Rx Ultrasonic Ping ))) SIG Serial Connector port to PC 12MHZ CRYSTAL Lampiran C-1 C1 + +5V C3 1uF R1 1k 33pF C2 33pf 19 18 9 29 30 31 U1 XTAL1 XTAL2 RST PSEN ALE EA P0.0/AD0 P0.1/AD1 P0.2/AD2 P0.3/AD3 P0.4/AD4 P0.5/AD5 P0.6/AD6 P0.7/AD7 P2.0/A8 P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 P2.5/A13 P2.6/A14 P2.7/A15 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 VCC +5V R6 1k 1 2 3 4 5 6 7 8 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 AT89C51 10 P3.0/RXD 11 P3.1/TXD 12 P3.2/INT0 13 P3.3/INT1 14 P3.4/T0 15 P3.5/T1 16 P3.6/WR 17 P3.7/RD Connector DB9 12 3 2 14 13 4 TOA TOB V + T2 OUT T1 OUT V- TIA TIB ROA ROB 11 5 1 15 R2 4K7 Ohm B C945 VCC +5V GND DCD DSR RXD RTS TXD CTS DTR RI 1 6 2 7 3 8 4 9

DAFTAR RIWAYAT HIDUP Saya yang bertanda tangan dibawah ini : DATA PRIBADI Nama : Ahmad Zainy Alamat : Jln. Young Panah Hijau Lor. Kayu Sepang Link IX Medan Labuhan Deli Medan Marelan Hp : 081398844066 E-Mail : ucox_nasti@yahoo.com Tempat/ tanggal lahir : Runding, 24 Oktober 1988 Jenis Kelamin : Laki-laki Status : Belum Menikah PENDIDIKAN 2007 2010 : DIII Teknik Komputer Institut Pertanian Bogor 2004 2007 : SMU Negeri 1 Panyabungan, jurusan IPA 2001 2004 : SMP Negeri 5 Panyabungan 1995 2001 : SD Negeri Runding SEMINAR Seminar IT To Day Institut Pertanian Bogor Demikianlah Daftar Riwayat Hidup ini saya perbuat dengan sebenarnya. Hormat Saya, Ahmad Zainy