Hi!

Habe das RN-Control 1.4 verbunden mit dem anx-s20:

http://www.autonomics.de/pd1123341209.htm?categoryId=1

Nun möchte ich das Servo 1 auf Mittelstellung setzen. Dazu habe ich folgenden Code:

Code:
$regfile = "m32def.dat"                                     'Die Anweisung bestimmt Ccntrollertyp, hier AVR Mega 32
$crystal = 16000000

$baud = 9600

' I2C SETUP
Config Scl = Portc.0
Config Sda = Portc.1
Config Twi = 100000

' CONSTANTS
Const ANX = &HC2

' FUNCTIONS
Declare Sub AnxWrite(byval Servo As Byte, byval Pos As Byte)

I2cinit
'Startet den I2C Bus

Sub AnxWrite(Servo As Byte, Pos As Byte)
   I2cstart
   I2cwbyte ANX
   I2cwbyte Servo + 62                                      ' 8-Bit Register ab Reg. 63
   I2cwbyte Pos
   I2cstop
End Sub

Call Anxwrite(1 , 127)
Print "Servo 1 ist jetzt in Mittelstellung"
Doch beim Compilieren mit Bascom spuckt er mir immer eine Fehlermeldung in der folgenden Zeile aus:

Code:
 I2cwbyte Servo + 62                                      ' 8-Bit Register ab Reg. 63
Woran liegt das?

Kann das mit dem Code funktionieren?

Danke!

Gruß

Dennis