private Sub ReadRFID(Buffer() As Byte)
Dim tmpBuffer () As Byte
Dim Str_HexNumber As String
Dim Int_Number As ULong
If BC.ArrayCompare(Buffer,BufferLast) = 0 Then Return'compare last read card to recent one
tmpBuffer= BC.SubString2(Buffer,3,11) 'get card bytes only, get ride of checksum and start byte
Str_HexNumber = BC.StringFromBytes(tmpBuffer)
Int_Number = Bit.ParseInt(Str_HexNumber, 16) 'convert hex to decimal string
If Int_Number = 0 Then Return
Dim Int_Str()As Byte = NumberFormat (Int_Number,10,0)
'OLED.StopScroll
RandomDisplayTimerTicks = 0 'avoid screen saver while reading (reset timer)
NoReadingTimerTicks = 0
DisplayCardNumber(Int_Str)
'Log(StackBufferUsage)
'BC.ArrayCopy(Buffer,BufferLast) 'copy last read to recent one, for next comparison
'BC.ArrayCopy2(Buffer,0,BufferLast,0,Buffer.Length)
For X = 0 To BufferLast.Length - 1 ' no erros with this solution, array copy or array copy2 causes ESP32 to reset
BufferLast(X) = Buffer(X)
Next
If BKP.isConnected Then
BKP.WriteStr(Int_Str,10)
BKP.Write(13)
BKP.Write(10)
BeepConfirm
End If
End Sub