Home » » SIMULASI PENGENDALI PUTARAN MOTOR KANAN-KIRI

SIMULASI PENGENDALI PUTARAN MOTOR KANAN-KIRI

Written By Unknown on Sabtu, 27 April 2013 | 01.04

Pada artikel kali ini saya posting sebuah simulator pengendali motor DC dengan Proteus untuk :
  1. Putar kanan
  2. Putar Kiri
  3. Stop
  4. Overload
dilengkapi dengan tampilan LCD 2 x 16 yang dapat melihat kondisi jalannya program :

Gambar Rangkaianya lengkap :




Berikut adalah bar code yang akan dimasukan .


List Code Bascom AVR :
$regfile = "m8535.dat"
$crystal = 4000000

Declare Sub Kanan()
Declare Sub Kiri()
Declare Sub Berhenti()
Declare Sub Ol()
Declare Sub Siap()

Ddrc.0 = 0 : Portc.0 = 1
Ddrc.1 = 0 : Portc.1 = 1
Ddrc.2 = 0 : Portc.2 = 1
Ddrc.3 = 0 : Portc.3 = 1
Ddrc.4 = 0 : Portc.4 = 1

Portb = 8

Config Portb = Output
Config Portc = Input
Config Lcd = 16 * 2
Config Lcdpin = Pin , Db4 = Portd.4 , Db5 = Portd.5 , Db6 = Portd.6 , Db7 = Portd.7 , E = Portd.3 , Rs = Portd.2
Cursor Off

Locate 1 , 1
Lcd "  MOTOR READY  "
Locate 2 , 1
Lcd "BINA ELEKTRONIKA"
Wait 2



Do
If Pinc.0 = 0 And Portb = 8 Then
Locate 1 , 1
Lcd "MOTOR SEDANG    "
Locate 2 , 1
Lcd "PUTAR KANAN >>> "
Gosub Kanan
End If

If Pinc.1 = 0 And Portb = 8 Then
Locate 1 , 1
Lcd "MOTOR SEDANG    "
Locate 2 , 1
Lcd "PUTAR KIRI <<<  "
Gosub Kiri
End If

If Pinc.2 = 0 Then
Locate 1 , 1
Lcd "MOTOR BERHENTI "
Locate 2 , 1
Lcd "               "
Gosub Berhenti
End If

If Pinc.3 = 0 Then
Locate 1 , 1
Lcd "WADUH OVERLOAD "
Locate 2 , 1
Lcd "SILAHKAN RESET "
Gosub Ol
End If

If Pinc.4 = 0 Then
Locate 1 , 1
Lcd "MOTOR SIAP     "
Locate 2 , 1
Lcd "DIJALANKAN     "
Gosub Siap
End If

Loop

Kanan:
Portb = 2
Waitms 0.3
Return

Kiri:
Portb = 1
Waitms 0.3
Return

Berhenti:
Portb = 8
Waitms 0.3
Return

Ol:
Portb = 4
Waitms 0.3
Return

Siap:
Portb = 8
Waitms 0.3
Return

End

Selamat mencoba dan semoga bermanfaat ......
Share this article :

1 komentar:

main-nav-top (Do Not Edit Here!)

 
Support : Your Link | Your Link | Your Link
Copyright © 2013. Gali Ilmu - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger