RaIdeN
19.08.2005, 15:30
Ich bekomme folgende Firmware nicht compiled! Kann mir jemand helfen? Bascom schmeisst den fehler aus: File not Found (???)
PS: Ich bin nicht der Beste Coder, is mein erstes projekt!
'Mikrokontroller Schalter Per UART'
'by RaIdeN7400 '
'Schaltet 8 Relais per UART oder 4 Schalter an/aus'
'V1.0'
$regfile = "2313def.dat"
$crystal = 3686400
$baud = 9600
Dim I As Byte
Dim An As Integer
Dim Aus As Integer
Ddrd = &B00100000
Ddrb = &B11111111
On Urxc Onrxd
Enable Urxc
Enable Interrupts
Main:
If Pind.3 = 1 Then
Portb.1 = 1
End If
If Pind.4 = 1 Then
Portb.2 = 1
End If
If Pind.5 = 1 Then
Portb.3 = 1
End If
If Pind.6 = 1 Then
Portb.4 = 1
End If
Goto Main
Onrxd:
Portd.2 = 1
I = Udr
Select Case I
Case "switch 1"
Toggle Portb.0
Print "Switched PortB.0!"
Case "switch 2"
Toggle Portb.1
Print "Switched PortB.1!"
Case "switch 3"
Toggle Portb.2
Print "Switched PortB.2!"
Case "switch 4"
Toggle Portb.3
Print "Switched PortB.3!"
Case "switch 5"
Toggle Portb.4
Print "Switched PortB.4!"
Case "switch 6"
Toggle Portb.5
Print "Switched PortB.5!"
Case "switch 7"
Toggle Portb.6
Print "Switched PortB.6!"
Case "switch 8"
Toggle Portb.7
Print "Switched PortB.7!"
Case "about"
Print "Relais Firmware V1.0 By RaIdeN"
Case "help"
Print "Du kannst PortB.0 - 7 per Command switch 1 - 8 an/ausschalten!"
Print "Unter status kannst du sehen,welche Ports an und aus sind!"
Case "status"
An = "An sind: "
Aus = "Aus sind: "
If Pinb.0 = 1 Then
An = An + "1 "
Else
Aus = Aus + "1 "
End If
If Pinb.1 = 1 Then
An = An + "2 "
Else
Aus = Aus + "2 "
End If
If Pinb.2 = 1 Then
An = An + "3 "
Else
Aus = Aus + "3 "
End If
If Pinb.3 = 1 Then
An = An + "4 "
Else
Aus = Aus + "4 "
End If
If Pinb.4 = 1 Then
An = An + "5 "
Else
Aus = Aus + "5 "
End If
If Pinb.5 = 1 Then
An = An + "6 "
Else
Aus = Aus + "6 "
End If
If Pinb.6 = 1 Then
An = An + "7 "
Else
Aus = Aus + "7 "
End If
If Pinb.7 = 1 Then
An = An + "8 "
Else
Aus = Aus + "8 "
End If
Printbin An
Printbin Aus
Case Else
Print "Unbekannter Befehl! Probier Mal help"
End Select
Wait 2
Return
Ich danke im Vorraus ;)
PS: Ich bin nicht der Beste Coder, is mein erstes projekt!
'Mikrokontroller Schalter Per UART'
'by RaIdeN7400 '
'Schaltet 8 Relais per UART oder 4 Schalter an/aus'
'V1.0'
$regfile = "2313def.dat"
$crystal = 3686400
$baud = 9600
Dim I As Byte
Dim An As Integer
Dim Aus As Integer
Ddrd = &B00100000
Ddrb = &B11111111
On Urxc Onrxd
Enable Urxc
Enable Interrupts
Main:
If Pind.3 = 1 Then
Portb.1 = 1
End If
If Pind.4 = 1 Then
Portb.2 = 1
End If
If Pind.5 = 1 Then
Portb.3 = 1
End If
If Pind.6 = 1 Then
Portb.4 = 1
End If
Goto Main
Onrxd:
Portd.2 = 1
I = Udr
Select Case I
Case "switch 1"
Toggle Portb.0
Print "Switched PortB.0!"
Case "switch 2"
Toggle Portb.1
Print "Switched PortB.1!"
Case "switch 3"
Toggle Portb.2
Print "Switched PortB.2!"
Case "switch 4"
Toggle Portb.3
Print "Switched PortB.3!"
Case "switch 5"
Toggle Portb.4
Print "Switched PortB.4!"
Case "switch 6"
Toggle Portb.5
Print "Switched PortB.5!"
Case "switch 7"
Toggle Portb.6
Print "Switched PortB.6!"
Case "switch 8"
Toggle Portb.7
Print "Switched PortB.7!"
Case "about"
Print "Relais Firmware V1.0 By RaIdeN"
Case "help"
Print "Du kannst PortB.0 - 7 per Command switch 1 - 8 an/ausschalten!"
Print "Unter status kannst du sehen,welche Ports an und aus sind!"
Case "status"
An = "An sind: "
Aus = "Aus sind: "
If Pinb.0 = 1 Then
An = An + "1 "
Else
Aus = Aus + "1 "
End If
If Pinb.1 = 1 Then
An = An + "2 "
Else
Aus = Aus + "2 "
End If
If Pinb.2 = 1 Then
An = An + "3 "
Else
Aus = Aus + "3 "
End If
If Pinb.3 = 1 Then
An = An + "4 "
Else
Aus = Aus + "4 "
End If
If Pinb.4 = 1 Then
An = An + "5 "
Else
Aus = Aus + "5 "
End If
If Pinb.5 = 1 Then
An = An + "6 "
Else
Aus = Aus + "6 "
End If
If Pinb.6 = 1 Then
An = An + "7 "
Else
Aus = Aus + "7 "
End If
If Pinb.7 = 1 Then
An = An + "8 "
Else
Aus = Aus + "8 "
End If
Printbin An
Printbin Aus
Case Else
Print "Unbekannter Befehl! Probier Mal help"
End Select
Wait 2
Return
Ich danke im Vorraus ;)