Anda di halaman 1dari 3

$sim

$regfile = "m8535.dat"
$crystal = 12000000
$eeprom
Dim X As Byte
Config Lcdpin = Pin , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 =
Portc.7 , E = Portc.2 , Rs = Portc.3
Config Lcd = 16 * 2 : Cursor Off
Dim Pwm As Integer
Dim Pwm_eprom As Eram Integer
Pwm = Pwm1a
Config Portc = Output
Config Portb = Output
Config Portd = Input
En1 Alias Portd.3
In1 Alias Portd.2
In2 Alias Portd.1
Config Timer1 = Pwm , Pwm = 10 , Prescale = 64 , Compare A Pwm = Clear
Down , Compare B Pwm = Clear Down
Do
Cls
In1 = 0
In2 = 1
Pwm1a = 35
Wait 5
Lcd "tes uji pwm"
Lowerline
Lcd "nilai pwm:" ; Pwm1a : Wait 3
Cls
Lcd "kecepaan lambat"
Wait 4
Cls
In1 = 0
In2 = 0
Pwm1a = 0
Wait 7
Lcd "tes uji pwm"
Lowerline
Lcd "nilai pwm:" ; Pwm1a : Wait 3
Cls
Lcd "yaaa mati"

Wait 4
Cls
In1 = 0
In2 = 1
Pwm1a = 50
Wait 7
Lcd "tes uji pwm"
Lowerline
Lcd "nilai pwm:" ; Pwm1a : Wait 3
Cls
Lcd "kecepatan naik"
Wait 4
Cls
In1 = 0
In2 = 0
Pwm1a = 0
Wait 7
Lcd "tes uji pwm"
Lowerline
Lcd "nilai pwm:" ; Pwm1a : Wait 3
Cls
Lcd "yaa lagi-lagi mati"
Wait 4
Cls
In1 = 0
In2 = 1
Pwm1a = 100
Wait 7
Lcd "tes uji pwm"
Lowerline
Lcd "nilai pwm:" ; Pwm1a : Wait 3
Cls
Lcd "wih ngebut banget"
Wait 4
Cls
In1 = 0
In2 = 0
Pwm1a = 0
Wait 7
Lcd "tes uji pwm"
Lowerline
Lcd "nilai pwm:" ; Pwm1a : Wait 3
Cls
Lcd "motor mulai mati"
Wait 4
Cls

Loop