Kamis, 02 November 2017

Sistem Kontrol Terprogram 
PROGRAM MOTOR DC PUTAR KANAN KIRI 


Jumat 03 November 2017
LAPORAN PRAKTEK
Nama     : Rizal Eka Putra
No/NIS  : 22/10773
Kelas     : XI TOI-2
Guru      : Suparno S.Pd M.Pd


I. Gambar ISIS




II. Program Bascom 

$regfile = "reg51.dat"
$crystal = 8000000

P1 = 0
P2 = 0

Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = P0.4 , Db5 = P0.5
Config Lcdpin = Pin , Db6 = P0.6 , Db7 = P0.7
Config Lcdpin = Pin , E = P0.1 , Rs = P0.0

Cursor Off
Locate 1 , 1
Lcd "       Motor       "
Locate 2 , 1
Lcd "  <<== READY ==>>  "


Do
'==============PUTAR KANAN ============
If P3.0 = 0 And P1.1 = 0 Then
   P2.0 = 1
   P2.1 = 0
   P1.0 = 1
   P1.1 = 0
   P1.2 = 0
   Locate 1 , 1
   Lcd "     Motor     "
   Locate 2 , 1
   Lcd "  << KANAN >>  "
   End If
'==============PUTAR KIRI==============
If P3.1 = 0 And P1.0 = 0 Then
   P2.0 = 0
   P2.1 = 1
   P1.0 = 0
   P1.1 = 1
   P1.2 = 0
   Locate 1 , 1
   Lcd "     Motor    "
   Locate 2 , 1
   Lcd "  << KIRI >>  "
   End If
'==============STOP====================
If P3.2 = 0 Then
   P2.0 = 0
   P2.1 = 0
   P1.0 = 0
   P1.1 = 0
   P1.2 = 1
   Locate 1 , 1
   Lcd "    MOTOR     "
   Locate 2 , 1
   Lcd " << STOP   >> "
   End If
'============= OVER LOAD =============
If P3.3 = 0 And P1.2 = 0 Then
   P2.0 = 0
   P2.1 = 0
   P1.1 = 0
   P1.0 = 0
   P1.3 = 1
   End If

If P3.4 = 0 Then
   P1.3 = 0
   End If






Loop