Komponen
- 2 buah IC 4094
- 2 buah seven Segmen
- Mikrokontroler
Rangkaian
Program:
$regfile = "m16def.dat"
$crystal = 12000000
Config Portb.0 = Output
Config Portb.1 = Output
Config Portb.2 = Output
Datain Alias Portb.0
Clock Alias Portb.1
Strobe Alias Portb.2
Dim Kodesat As Byte , Npul As Integer , Nsat As Integer , Kodepul As Byte
Mulai:
Npul = 3
Nsat = 0
Do
Gosub Tampil
If Nsat = 0 Then
Nsat = 9
Decr Npul
End If
If Npul = 0 And Nsat = 0 Then
Goto Mulai
End If
Gosub Tampil
Decr Nsat
Loop
Tampil:
Reset Strobe
Kodesat = Lookup(nsat , Kode)
Kodepul = Lookup(npul , Kode)
Shiftout Datain , Clock , Kodesat , 1
Shiftout Datain , Clock , Kodepul , 1
Waitms 500
Set Strobe
Return
Kode:
Data &H40 , &H79 , &H24 , &H30 , &H19 , &H12 , &H02 , &H78 , &H00 , &H10
$crystal = 12000000
Config Portb.0 = Output
Config Portb.1 = Output
Config Portb.2 = Output
Datain Alias Portb.0
Clock Alias Portb.1
Strobe Alias Portb.2
Dim Kodesat As Byte , Npul As Integer , Nsat As Integer , Kodepul As Byte
Mulai:
Npul = 3
Nsat = 0
Do
Gosub Tampil
If Nsat = 0 Then
Nsat = 9
Decr Npul
End If
If Npul = 0 And Nsat = 0 Then
Goto Mulai
End If
Gosub Tampil
Decr Nsat
Loop
Tampil:
Reset Strobe
Kodesat = Lookup(nsat , Kode)
Kodepul = Lookup(npul , Kode)
Shiftout Datain , Clock , Kodesat , 1
Shiftout Datain , Clock , Kodepul , 1
Waitms 500
Set Strobe
Return
Kode:
Data &H40 , &H79 , &H24 , &H30 , &H19 , &H12 , &H02 , &H78 , &H00 , &H10
Download Link:
Simulasi Proteus --- klik disini
program ----------- klik disini
wasalam
