philiph
01.10.2006, 12:08
Also ich möchte einen eingelesenen ADC Wert mit im EEPROM gespeicherten daten abgleichen leider bekomme ich beim Combilieren immer einen error 242 (Source variable does not match the target....)
mein Code:
....
Dim Pos As Byte
Dim Pos2 As Byte
Dim Pos3 As Byte
Dim V As Word
Channel As Byte
Dim L1 As Byte
Dim L As String * 2
Dim Pos As Byte
Dim Pos2 As Byte
Dim Pos3 As Byte
Dim Tempdata(35) As String * 3
Dim Eepromdata(3) As Word
Dim Y As Byte
.....
Channel = 0
V = Getadc(channel)
Readeeprom L , 1 <--Länge der gespeicherten EEPromdaten auslesen
L1 = L
Pos = 2
Pos2 = 3
Pos3 = 4
For Y = 1 To L1 <--EEprom auslesen
Tempdata(y) = Readeeprom Eepromdata(1) , Pos + Readeeprom Eepromdata(2) , Pos2 + Readeeprom Eepromdata(3) , Pos3
Pos = Pos + 3
Pos2 = Pos2 + 3
Pos3 = Pos3 + 3
Next
For Y = 1 To L1 <--vergleichen
If Tempdata(y) = Str(v) Then
Print "Match found"
End If
Next
Goto Main
mein Code:
....
Dim Pos As Byte
Dim Pos2 As Byte
Dim Pos3 As Byte
Dim V As Word
Channel As Byte
Dim L1 As Byte
Dim L As String * 2
Dim Pos As Byte
Dim Pos2 As Byte
Dim Pos3 As Byte
Dim Tempdata(35) As String * 3
Dim Eepromdata(3) As Word
Dim Y As Byte
.....
Channel = 0
V = Getadc(channel)
Readeeprom L , 1 <--Länge der gespeicherten EEPromdaten auslesen
L1 = L
Pos = 2
Pos2 = 3
Pos3 = 4
For Y = 1 To L1 <--EEprom auslesen
Tempdata(y) = Readeeprom Eepromdata(1) , Pos + Readeeprom Eepromdata(2) , Pos2 + Readeeprom Eepromdata(3) , Pos3
Pos = Pos + 3
Pos2 = Pos2 + 3
Pos3 = Pos3 + 3
Next
For Y = 1 To L1 <--vergleichen
If Tempdata(y) = Str(v) Then
Print "Match found"
End If
Next
Goto Main