SubName: Set all EEPROM bytes to zero.
Description: This example illustrates how to set of all of the bytes to zero (0), initialising them to hold new information, using the EEPROM.WriteBytes function.
Please take note that the EEPROM apparently has a 100,000 Read/Write life cycle, give or take.
Tags: EEPROM, Clear, Memory
Description: This example illustrates how to set of all of the bytes to zero (0), initialising them to hold new information, using the EEPROM.WriteBytes function.
Please take note that the EEPROM apparently has a 100,000 Read/Write life cycle, give or take.
B4X:
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 EEP As EEPROM
Public LEDPin As Pin
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Delay(2000)
Log("AppStart")
Log("Size: ", EEP.Size, " bytes")
For i = 0 To EEP.Size
EEP.WriteBytes(Array As Byte(0), i)
Log(i)
Next
LEDPin.Initialize(2, LEDPin.MODE_OUTPUT) '2 for WeMos, 13 for Arduino
LEDPin.DigitalWrite(False)
End Sub
Tags: EEPROM, Clear, Memory
Last edited: