Habe keinen ISP. Programmiere über den Bootloader. Und zwar über den Lawicel BootLoader.
Das folgende Programm funktioniert einwandfrei:
Sobald ich "Input S" setze und ohne "if-Schleife" irgendeinen Integer Wert abfrage, geht nichts. Habe auch die Mhz verändert und bekomme dann Falsche Werte. Also daran glaube ich kann es nicht liegen.Code:$regfile = "M32DEF.DAT" ' Mega32 $crystal = 14745600 ' StAVeR-40 XTAL $baud = 9600 Dim S As Integer ' Sende Integerwert Dim Mybaud As Long Config Porta = Output 'Config Portd.0 = Input Do Print "hello" 'Wenn Input Integer 1 dann Porta.0 = 1 Porta.1 = 1 Porta.2 = 1 Porta.3 = 1 Porta.4 = 1 Porta.5 = 1 Porta.6 = 1 Porta.7 = 1 Wait 2 Porta.0 = 0 Porta.1 = 0 Porta.2 = 0 Porta.3 = 0 Porta.4 = 0 Porta.5 = 0 Porta.6 = 0 Porta.7 = 0 Wait 2 Loop
Hi,
jetzt funktioniert es!!
Ich muss zusätzlich immer die Return Taste drücken.Code:$regfile = "M32DEF.DAT" ' Mega32 $crystal = 14745600 ' StAVeR-40 XTAL $baud = 9600 Dim S As Integer ' Sende Integerwert Dim Mybaud As Long Config Porta = Output 'Config Portd.0 = Input Do Input S ' Warte auf Input von RS232 If S = 1 Then Print "hello" 'Wenn Input Integer 1 dann Porta.0 = 1 Porta.1 = 1 Porta.2 = 1 Porta.3 = 1 Porta.4 = 1 Porta.5 = 1 Porta.6 = 1 Porta.7 = 1 Wait 2 Porta.0 = 0 Porta.1 = 0 Porta.2 = 0 Porta.3 = 0 Porta.4 = 0 Porta.5 = 0 Porta.6 = 0 Porta.7 = 0 Wait 2 End If Loop
Warum ist das so??. Gibts keine Möglichkeit ohne RETURN Taste zu arbeiten?
ja,
schau Dir mal diese Befehle in der Hilfe an:
Ischarwaiting, Waitkey, Inkey
Da ist auch immer ein Beispiel dabei.
Vielen Dank für die Hilfe!
Mit Inkey() läuft das Prima.
Lesezeichen