alexa-tracking

Main Content

1024
1024
KASKUS
51
244
https://www.kaskus.co.id/thread/52ea83790d8b461c458b4629/mikrokontroller-atmega8535-input-infrared-sederhana
Hepi 
Mikrokontroller atmega8535 input infrared sederhana
Dear Agan2,

bisa bantu dikit permasalahan ane ga ya tentang Mikrokontroller dan infrared (PortD). Kok kagak mau jalan ya ni syntax. Mohon panduannya untuk syntax ini :

$regfile = "m8535.dat"
$crystal = 11059200
$baud = 4800


Config Adc = Single , Prescaler = Auto , Reference = Internal
Config Lcdpin = Pin , Db4 = Portb.2 , Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portb.5 , E = Portb.1 , Rs = Portb.0

Config Lcd = 16 * 2

Config Pind.7 = Input

Inser Alias Pind.7

Dim Masuk As Word
Dim Jumlah As Word
Dim Keluar As Word

Masuk = 0

Declare Sub Inser

Cls

Do
Locate 1 , 1
Lcd "Jumlah Masuk =" ; Masuk

If Jumlah = 0 Then
Masuk = 0
Else
If Inser = 1 Then
Masuk = Masuk + 1
End If
End If
Lowerline
Lcd "Sisa Parkir =" ; Jumlah

Jumlah = 20 - Masuk

Wait 1
Cls
Loop
End

Makasih ganemoticon-Bingung (S)