Ports Schalten in bascom wenn zeichen von HT kommt

OP (Firma: RF-I) #988796
Lesenswert?

Kann das so funktionieren wenn ich per Hyperterminal die buchstaben E 
und die zahl 3 an den Uc sende

Hab was altes wieder ausgegraben

$regfile = "m88def.dat"

$crystal = 8000000

$baud = 19200

config PortB.1 = output
config PortB.2 = output
config PortA.1 = output

Dim Akey As Byte  'Here we declare a byte variable

Do

Akey = Waitkey()

If Akey = 69 Then          ' E senden zum schalten
PortB.1 = 1
End if

If Akey = 51 Then          ' 3 Senden an uC um zu agieren
PortB.1 = 0
End if

Loop

End
OP (Firma: RF-I) #988833
Lesenswert?

$regfile = "m88def.dat"

$crystal = 8000000

$baud = 19200

config PortB.1 = output
config PortB.2 = output
config PortA.1 = Input

Dim Akey As Byte  'Here we declare a byte variable

Do

Akey = Inkey()

If Akey = 69 Then          ' E senden zum schalten
Toggle Portb.1
End if

If Porta.1 = 1 Then
Toggle PortB.1
End if

Loop

End

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren