Hi,
hab ich das jetzt richtig verstanden: Wenn ich einen Pin als eingang
konfigurieren will, dann muss ich zuerst
Config Pinx.y (oder Portx) = Input schreiben, dann kann ich den Eingang
einlesen:
Variable = Pinx.y
Wenn ich einen Ausgang haben will, dann muss ich schreiben:
Config Pinx.y (oder Portx) = Output
und dann:
Pinx.y = 1
Dann habe ich noch etwas komisches gesehen (Zitat aus der Hilfe):
'Again, note that the AVR port pins have a data direction register
'when you want to use a pin as an input it must be set low first
'you can do this by writing zeros to the DDRx:
'DDRB =&B11110000 'this will set portb1.0,portb.1,portb.2 and portb.3
to use as inputs.
'So : when you want to use a pin as an input set it low first in the
DDRx!
' and read with PINx
' and when you want to use the pin as output, write a 1 first
' and write the value to PORTx
Was bedeutet das? Muss ich also vorher noch den Befehl
DDRx (x für Port) = &B11111110 ausführen, wenn der 1 Pin des Ports x
als Eingang konfiguriert ist?