Ausgänge schalten

Gast #43494
Lesenswert?
• ▲
▼
hallo zusammen!

habe ein kleines problem, da ich von c-control auf die avr´s
umgestiegen bin. wie schalte ich einen ausgang? wenn ich das so mache
gehts nicht:

Config Pinc.4 = Input
Config Pinc.7 = Output

Dim Motor_ein As Bit

Main:

If Pinc.4 = 1 Then Motor_ein = 1 Else Motor_ein = 0

Pinc.7 = Motor_ein

Goto Main

da kommt der fehler: "you cannot write to a pin register"

kann mir jemand helfen?

mfg Stephan
Gast #43498
Lesenswert?
• ▲
▼
Hallo Stephan:
Noch ein "Motorcode" in Bascom AVR

Config Pinc.4 = Input
Config Pinc.7 = Output
Const Aus = 1
Const An = 0
Motor Alias Portc.7
Do
If Pinc.4 = 1 Then
Motor = An
Else
Motor = Aus
End If
Loop

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