Hallo Michael,
vielen Danke für deine Anwort. Ich habe den Code mal entsprechend geändert. Jetzt sieht er so aus - richtig?
Code:
'===============================================================================
' Compiler
'===============================================================================
$regfile = "m32def.dat" 'Mega32
$crystal = 1000000 '1Mhz Quarz
'-------------------------------------------------------------------------------
'===============================================================================
' Ein- und Ausgänge
'===============================================================================
Config Pind.4 = Input 'Empfängersignal
'-------------------------------------------------------------------------------
'===============================================================================
' Variablen
'===============================================================================
Dim Pulsbreite As Word
'-------------------------------------------------------------------------------
'===============================================================================
' LCD Parametrieren
'===============================================================================
Config Lcdpin = Pin , Db4 = Porta.4 , Db5 = Porta.3 , Db6 = Porta.2 , _
Db7 = Porta.1 , E = Porta.5 , Rs = Porta.6
Config Lcd = 16 * 2
Cls
Cursor Off Noblink
'-------------------------------------------------------------------------------
'*******************************************************************************
'* HAUPTPROGRAMM *
'*******************************************************************************
Do
Pulsein Pulsbreite , Pind , 4 , 1 'Pulsbreite auslesen
Cls ' LCD Ausgabe
Lcd "Puls: "
Lcd Pulsbreite
Waitms 20 'Aktualisierungsintervall
Loop
'-------------------------------------------------------------------------------
'===
End
'===
Gruß, Björn
Lesezeichen