Sorry, wenn ich jetzt nerve, aber ich denke viele Leute brauchen mal eine arbeitende PrintToManchseter... Funktion, also bitte helft mir.
Würde es so funktionieren (Empfänger)?
Und würde Bitwait nicht ständig ein Bit beim Flackern empfangen?
Code:
$baud = 2400
'#######################
'# LCD-Konfigurationen #
'#######################
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portb.0 , Db6 = Portb.1 , Db7 = Portb.2 , E = Portb.3 , Rs = Portb.4 ' Natürlich so wie es wirklich angeschlossen ist (4-Bit-Modus)
Config Lcd = 16 * 2
Initlcd
Display On
Cursor Off
Cls
'#######################
'# Variablen #
'#######################
Declare Function M2b(byval Minput As Word) As Byte
Dim A As Word
Dim B As Byte
Dim I As Byte
Dim I2 As Byte
'#######################
'# Hauptprogramm #
'#######################
Do
Home
Bitwait Portd.1 , Set
A = Inkey()
If A > 0 Then
B = M2b(a)
Lcd "IN: " ; Chr(b)
End If
Loop
'#######################
'# Funktion(en) #
'#######################
Function M2b(byval Minput As Word) As Byte
For I = 0 To 15 Step 2
I2 = I / 2
Select Case Minput.i
Case 1 : M2b.i2 = 0
Case 0 : M2b.i2 = 1
End Select
Next
End Function
End
MFG Moritz
Lesezeichen