Anda di halaman 1dari 7

Nama : Inten Soeweno Syapyuza

Kelas : 5 ELA
NIM : 061440340725

Rangkaian RTC(real time clock)

Skematik RTC DS1307

RTC DS1307
Listrik AC PLN 220 V

LAMPU AC 220
VOLT
PC
Rangkaian Tidak Ya
RTC untuk
Ya
menyalakan dan memadamkan lapu dengan tampilan VB

Tidak
Tidak
Ya Ya

FLOWCHART
Mulai

PC
Inisialisasi Port
Relay akan,Register dan VariabelRelay akan Apakah Port Terkoneksi?
Jam = 18:00 Jam = 06:00 Menampilkan
mendapatkan logika mendapatkan logika
Data RTC Berupa Menu Utama
Informasi yang di
HIGH artinya lampu LOW artinya lampu
Selesai Database
akan menyala Relay Jamdi pin 13akan padam terima dari Arduino
Tampilan Visual Basic
Program Visual Basic

Private Sub cmdConnect_Click()

If MSComm1.PortOpen = False Then

MSComm1.DTREnable = True

MSComm1.RTSEnable = True

MSComm1.InputMode = comInputModeText

MSComm1.RThreshold = 1

MSComm1.SThreshold = 80

MSComm1.InputLen = 0

MSComm1.CommPort = 3

MSComm1.Settings = "9600,N,8,1"

MSComm1.PortOpen = True

cmdConnect.Enabled = False

cmdDisconnect.Enabled = True
End If

Private Sub cmdDisconnect_Click()

If MSComm1.PortOpen = True Then

MSComm1.PortOpen = False

End If

cmdConnect.Enabled = True

cmdDisconnect.Enabled = False

End Sub

Private Sub MSComm1_OnComm()

Dim wenoSyapyuza As String

wenoSyapyuza = MSComm1.Input

If wenoSyapyuza <> "" Then

With Text1

.SelStart = Len(.Text)

.SelText = wenoSyapyuza

End With

End If

End Sub

Private Sub Timer1_Timer()

MSComm1_OnComm

End Sub

Program RTC Arduino