Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Public bc As ByteConverter
Dim eeprom As EEPROM
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Dim res() As Int=readlastdate(0)
Log(res(0)," ",res(1)," ",res(2))
Log("AFTER")
writelastdate(0,Array As Int(11,22,33)) 'whatever values I put here I get always the same readout before and after write
Dim resi() As Int=readlastdate(0)
Log(resi(0)," ",resi(1)," ",resi(2))
writelastdate(0,Array As Int(44,55,66)) 'whatever values I put here I get always the same readout before and after write
Dim resi() As Int=readlastdate(0)
Log(resi(0)," ",resi(1)," ",resi(2))
writelastdate(0,Array As Int(77,88,99)) 'whatever values I put here I get always the same readout before and after write
Dim resi() As Int=readlastdate(0)
Log(resi(0)," ",resi(1)," ",resi(2))
End Sub
Sub readlastdate(off As Int)As Int()
Dim by() As Byte=eeprom.ReadBytes(64*off,6)
Dim dat() As Int=bc.IntsFromBytes(by)
Return dat
End Sub
Sub writelastdate(off As Int,data() As Int)
Dim by() As Byte=bc.IntsToBytes(data)
eeprom.WriteBytes(by, 64*off)
End Sub