# Function EEPROM.update return

**URL:** <https://forum.arduino.cc/t/function-eeprom-update-return/912121>\
**Category:** Programming\
**Created:** [October 5, 2021, 10:17pm UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121 "2021-10-05T22:17:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruilviana](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ruilviana/32/722429_2.png) [@ruilviana](https://forum.arduino.cc/u/ruilviana)\
**Post date:** [October 5, 2021, 10:17pm UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/1 "2021-10-05T22:17:21Z")

</div>

Hi everyone.

I have a question and I didn't find any information. (or I didn't know how to look for it).

The EEPROM.put() function uses the EEPROM.update() function to  
write each byte of data to EEPROM.

If the byte value to be written by the EEPROM.update() function  
is equal to the value that is already written to the EEPROM, writing is not necessary.

It is possible to know if the EEPROM.update() function needed to write?

Is there any feedback that informs if there was no recording?

Where (in the core of the IDE) I find the function code  
EEPROM.update() ?

Thanks in advance.

RV mineirin

---

<div class="post-metadata">

**Author:** ![blh64](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/blh64/32/605986_2.png) [@blh64](https://forum.arduino.cc/u/blh64)\
**Post date:** [October 5, 2021, 10:28pm UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/2 "2021-10-05T22:28:15Z")

</div>

EEPROM.update() is of type void so there is no return value.

You can see the source at `C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM\src`

---

<div class="post-metadata">

**Author:** ![ruilviana](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ruilviana/32/722429_2.png) [@ruilviana](https://forum.arduino.cc/u/ruilviana)\
**Post date:** [October 5, 2021, 10:30pm UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/3 "2021-10-05T22:30:33Z")

</div>

Tks.

---

<div class="post-metadata">

**Author:** ![lastchancename](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/lastchancename/32/215426_2.png) [@lastchancename](https://forum.arduino.cc/u/lastchancename)\
**Post date:** [October 5, 2021, 10:42pm UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/4 "2021-10-05T22:42:40Z")

</div>

or, you could compare the new value with the last known value - and there’s your answer.

Don’t you trust the .update functionality ? 😱

---

<div class="post-metadata">

**Author:** ![ruilviana](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ruilviana/32/722429_2.png) [@ruilviana](https://forum.arduino.cc/u/ruilviana)\
**Post date:** [October 5, 2021, 10:55pm UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/5 "2021-10-05T22:55:03Z")

</div>

> [@lastchancename](#):
>
> Don’t you trust the .update functionality ? 😱

Thanks @lastchancename for the answer.

No, it's not a distrust of the EEPROM.update function no.

It was an idea that came to me in a small project.  
If I tried to write the value and found that it was the same, I wouldn't need to read it to compare with the current value.

RV mineirin

---

<div class="post-metadata">

**Author:** ![blh64](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/blh64/32/605986_2.png) [@blh64](https://forum.arduino.cc/u/blh64)\
**Post date:** [October 6, 2021, 12:54am UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/6 "2021-10-06T00:54:58Z")

</div>

> [@ruilviana](#):
>
> If I tried to write the value and found that it was the same, I wouldn't need to read it to compare with the current value.

But that is exactly what .update() does. So, you can either let the library do it, or you can do it, but if you bother to read and compare, you might as well just .write() if they are not the same or else the library will repeat everything you have done.

---

<div class="post-metadata">

**Author:** ![ruilviana](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ruilviana/32/722429_2.png) [@ruilviana](https://forum.arduino.cc/u/ruilviana)\
**Post date:** [October 6, 2021, 12:58am UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/7 "2021-10-06T00:58:32Z")

</div>

Tks.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [April 4, 2022, 12:58am UTC](https://forum.arduino.cc/t/function-eeprom-update-return/912121/8 "2022-04-04T00:58:45Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
