percobaan penghitung frekuensi

Upload: herry-sanjaya

Post on 14-Jan-2016

215 views

Category:

Documents


0 download

DESCRIPTION

masih berupa percobaan dasar menggunakan bascom avr

TRANSCRIPT

Percobaan Penghitung Frekuensi (hanya percobaan)$regfile = "m8535.dat"$crystal = 12000000

Config Lcdpin = Pin , Rs = Portc.0 , E = Portc.1 , Db4 = Portc.2 , Db5 = Portc.3 , Db6 = Portc.4 , Db7 = Portc.5Config Lcd = 16 * 2Dim Putar As ByteDim Hasil As WordCursor Off

Cls

Config Timer1 = Counter , Edge = FallingConfig Pinb.7 = Input

Declare Sub Tahan

Locate 1 , 1 Lcd "TEP FTP"

Locate 2 , 1 Lcd "busan" Wait 1

For Putar = 1 To 15 Shiftlcd Left Waitms 25 Next

Waitms 100

Cls

Tombol1 Alias Pinb.7Set Portb.7

Mulai: Cls Set Portb.7

Do

Start Timer1 Wait 1 Stop Timer1

Locate 1 , 1 Lcd "FREKUENSI " Locate 2 , 1 Lcd "FREQ : "

Locate 2 , 8 Lcd Counter1 ; " HZ " Hasil = Counter1 Counter1 = 0

If Tombol1 = 0 Then Call Tahan End If

Loop

Tahan:

Locate 1 , 1 Lcd "FREKUENSI (hold)" Locate 2 , 1 Lcd "FREQ : "

Locate 2 , 8

Lcd Hasil ; " HZ "

Return