You are on page 1of 5

Bab 1

Modul 1
1.4.1
Coding

:

$regfile = "m16def.dat"
$crystal = 11059200
Config Portd = Output
Port_steeper Alias Portd
Dim Port_steeper As Byte , X As Byte
Portd = &B00001111
Portd = &B11110000
Do
For X = 1 To 8
Portd = &B00001111
Waitms 10
Next
For X = 1 To 8
Portd = &B11110000
Waitms 10
Next
Loop

1.4.2
Coding :
$regfile = "m16def.dat"
$crystal = 11059200
Config Portd = Output
Port_led Alias Portd
Dim Data_led As Byte , X As Byte
Data_led = &B00000001
Do
For X = 1 To 6
Port_led = Data_led
Waitms 50
Rotate Data_led , Left , 1
Next X
For X = 1 To 6
Port_led = Data_led
Waitms 20
Rotate Data_led , Left , 1
Next X
Loop

1.4.3
Coding :
$regfile = "m16def.dat"

$crystal = 11059200 Config Portd = Output Port_acc Alias Portd Dim Data_acc As Byte . X As Byte Data_acc = &B00000000 Do For X = 1 To 15 Port_acc = Data_acc Waitms 50 Decr Data_acc Next X For X = 1 To 15 Port_acc = Data_acc Waitms 50 Incr Data_acc Next X Loop Module 2 2.4.2 Coding : $regfile = "m16def.dat" $crystal = 11059200 $baud = 9600 Config Portc = Output Config Porta = Output Do Portc = &B00111000 Porta = &B10000000 Waitms 250 'L Portc = &B01011111 Porta = &B01000000 Waitms 250 'a Portc = &B01111100 Porta = &B00100000 Waitms 250 'b Portc = &B01000000 Porta = &B00010000 Waitms 250 '- Portc = &B01111001 Porta = &B00001000 'E .

dat" $crystal = 11059200 $baud = 9600 Config Portc = Output Config Porta = Output Do Portc = &B01011111 Porta = &B00000001 Waitms 1 'a Portc = &B01110101 Porta = &B00000010 Waitms 1 'k Portc = &B00111000 Porta = &B00000100 Waitms 1 'L Portc = &B01111001 Porta = &B00001000 Waitms 1 'E Portc = &B01000000 Porta = &B00010000 Waitms 1 '- Portc = &B01111100 Porta = &B00100000 Waitms 1 'b Portc = &B01011111 Porta = &B01000000 Waitms 1 'a .Waitms 250 Portc = &B00111000 Porta = &B00000100 Waitms 250 'L Portc = &B01110101 Porta = &B01000000 Waitms 250 'k Portc = &B01011111 Porta = &B00000001 Waitms 250 Loop 'a 2.4.2 Coding : $regfile = "m16def.

3 . Db6 = Portc. Db5 = Portc. Db4 = Portc.6 .1 Coding : 'proram LCD03.7 Config Lcd = 17 * 2 Dim Pos As Byte Do Cls Upperline Lcd "Handry | Fadhil" Lowerline Lcd "Universitas Muhammadiyah Sidoarjo" For Pos = 0 To 16 Step 1 Waitms 200 Shiftlcd Left Left Next Pos Loop 3.3 . Db7 = Portc. E = Portc. 1 ' mulai lokasi baris .4.dat" $crystal = 11059200 Config Lcdpin = Pin . Db4 = Portc.2 .2 kolom 7' Lcd "Gelam" End .1 kolom 7 ' Lcd "Umsida D3" Locate 2 .BAS' Config Lcdpin = Pin . Rs = Portc.2 Coding : $regfile = "m16def. Rs = Portc. 2 ' mulai lokasi baris .5 . Db6 = Portc.5 .4 .dat" $crystal = 11059200 'program LCD03.2 .Portc = &B00111000 Porta = &B10000000 Waitms 1 Loop 'L Modul 3 3.4.6 . Db5 = Portc. Db7 = Portc.BAS' $regfile = "m16def.4 .7 Config Lcdpin = 16 * 2 Cursor Of Cls Locate 1 . E = Portc.

1 Coding : .Module 4 4.4.