Untitled
By: a guest | Mar 19th, 2010 | Syntax:
None | Size: 1.00 KB | Hits: 92 | Expires: Never
$regfile = "2313def.dat"
$crystal = 16000000
$baud = 9600
$hwstack = 32
$swstack = 10
$framesize = 40
Config Portb.0 = Output
Config Portb.1 = Output
Config Portb.2 = Output
Config Portb.3 = Output
Dim Bytel As Byte , Byter As Byte
Dim Intl As Integer , Intr As Integer
Dim Timpl As Long , Timpr As Long
Dim I As Long
Portb.2 = 0
Portb.3 = 0
Timpl = 0
Timpr = 0
Enable Interrupts
On Int1 Citire
Do
Portb.0 = 1
Portb.1 = 1
For I = 1 To 1000 Step 10
If I >= Timpl Then
Portb.0 = 0
End If
If I >= Timpr Then
Portb.1 = 0
End If
Waitus 7
Next
Loop
Citire:
Inputbin Bytel
Inputbin Byter
Intl = Bytel
Intr = Byter
Intl = Intl - 128
Intr = Intr - 128
Intl = Abs(intl)
Intr = Abs(intr)
Timpl = Intl
Timpr = Intr
Timpl = 1000 * Timpl
Timpr = 1000 * Timpr
Timpl = Timpl / 255
Timpr = Timpr / 255
If Bytel < 128 Then
Portb.2 = 1
Else
Portb.2 = 0
End If
If Byter < 128 Then
Portb.3 = 1
Else
Portb.3 = 0
End If
Return