Hallo,
das tut mir jetz Leid.
In dem Board ist ein ATmega88 verbaut.
Hier nochmal der Code
Code:
'Das ist das erste Programm mit Bascom Basic
$regfile = "m88def.dat"
$crystal = 8000000
$baud = 19200
Led Alias Portb.6
Config Led = Output
Led = 0
Sw1 Alias Pind.2
Config Sw1 = Input
Portd.2 = 1
Const Pi = 3.14
Dim Byte1 As Byte
Dim Byte2 As Byte
Dim Ich_bin_eine_variable As Word
Declare Function Testfunktion(byval A As Byte , Byval B As Byte) As Word
Declare Sub Led_toggle()
'Hauptprogramm
Do
'Hier steht das eigentliche Programm
'In der Funktion wird der Wert berechnet und
'an "ich bin eine Variabel" übergeben.
Print "Zwei Zahlen mit Bascom addieren"
Print
Input "Ersten Wert eingeben: " , Byte1
Input "Zeiten Wert eingeben: " , Byte2
Ich_bin_eine_variable = Testfunktion(byte1 , Byte2)
Print "Ergebnis = " ; Ich_bin_eine_variable ; Chr(10) ; Chr(13)
Print "Taste SW1 druecken um fortzufahren!" ; Chr(10) ; Chr(13)
Do
Led_toggle
Loop Until Sw1 = 0
Loop
End
'Funktionen und Prozeduren
Function Testfunktion(a As Byte , B As Byte) As Word
Testfunktion = A + B
End Function
Sub Led_toggle()
Toggle Led
Waitms 250
End Sub
Lesezeichen