Jumat, 21 Oktober 2016

Program Menyalakan Lampu dengan tombol (Tulis dengan Bascom AVR)

$regfile = "m16.dat"
$crystal = 16000000
Config Porta = Input
Porta = &HFF
Config Portc = Output
Portc = &HFF
Do
If Pina.0 = 0 Then
Portc = &B11111110
Elseif Pina.1 = 0 Then
Portc = &B11111101
Elseif Pina.2 = 0 Then
Portc = &B11111011
Elseif Pina.3 = 0 Then
Portc = &B11110111
Elseif Pina.4 = 0 Then
Portc = &B11101111
Elseif Pina.5 = 0 Then
Portc = &B11011111
Elseif Pina.6 = 0 Then
Portc = &B10111111
Elseif Pina.7 = 0 Then
Portc = &B01111111
End If
Loop
End

Tidak ada komentar: