About Arduino M0

I am exploring the Arduino M0.
I wish to use the EEPROM command but error 'compilation is terminated' is what I get.

Any idea of the unique EEPROM code for the Arduino M0?
(P.S. The EEPROM command can be compiled through UNO but no M0)

Desperately seeking for help...

I wish to use the EEPROM command but error 'compilation is terminated' is what I get.

Compilation is NOT terminated unless something else is reported. You start fixing errors at the top, NOT at the bottom.

This section of the forum REQUIRES that you post your code.

Sorry about that. Below is the code I’m using. Just a very simple EEPROM write and read.

For Write

#include <EEPROM.h>
int addr = 0; //Can be from 0 to 512
int val = 0; // Can be from 0 to 255
void setup()
{
  EEPROM.write(addr, val);
}
void loop()
{
}

For Read

#include <EEPROM.h>
int Addr=0;
int Value =0; 
void setup()
{
  Serial.begin(38400);
Value = EEPROM.read(Addr);
Serial.println(Value);
}
void loop()
{ 
}

And the complete error message(s)?

This is the error I get.

:
#include <EEPROM.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino M0.
//

There is nothing on the M0 product page that indicates that it HAS any EEPROM. Why do you think it does?

ya so any example code to have the exactly same function as EEPROM.read on Arduino M0? I wish to save data to the memory...

I wish to save data to the memory...

To what memory? To the EEPROM that you don't have?

Add an external EEPROM chip, if you just absolutely must have EEPROM.

I wish to save data so that the next time I reset the Arduino, the values is still there (for further purpose).
Any way of doing that ?

(available in the Library Manager)

Thanks for the reply but I still cannot compile each of the example using the Arduino M0 board...

Very thank you to Oqibidipo, the code work after I have install the relevant library. Big thanks.