Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in the description of the library EEPROM.get () #3841

Open
pakhontas opened this issue Sep 22, 2015 · 6 comments
Open

Error in the description of the library EEPROM.get () #3841

pakhontas opened this issue Sep 22, 2015 · 6 comments
Assignees
Labels
Component: Documentation Related to Arduino's documentation content feature request A request to make an enhancement (not a bug fix) Library: EEPROM The EEPROM Arduino library

Comments

@pakhontas
Copy link

pakhontas commented Sep 22, 2015

https://docs.arduino.cc/learn/built-in-libraries/eeprom#get

Now:

eeAddress = sizeof(float); //Move address to the next byte after float 'f'.

Need:

eeAddress += sizeof(float); //Move address to the next byte after float 'f'.
@Chris--A
Copy link
Contributor

As the initial value is zero, adding sizeof(float) is no different to making it equal to sizeof(float). It is still moving to the byte after f.

@pakhontas
Copy link
Author

In this case comment to row is wrong
It's not move.
in this description, I think more accurately comment:
https://www.arduino.cc/en/Reference/EEPROMPut (eeAddress += sizeof(float);)

@Chris--A
Copy link
Contributor

Yes, the address 'pointer' is moving to the location specified by the comment. Whether its explicit or compounded is irrelevant.

If its a confusing issue, I can however certainly modify my examples to alleviate this. I have an update to my library which fixes all warnings and improves performance. I'll change this over and the documentation can be updated once proposed & accepted.

@pakhontas
Copy link
Author

if first value of eeAddress set to not zero.
code in Get() becomes wrong.
If you think that just fine, of course, that is your right.
but I think that + = is understandable. thank.

@Chris--A
Copy link
Contributor

Of course, there is an issue if the previous address is not 0. I guess for a newbie point of view, its always best to follow 'KISS' principles. I will update the bundled examples with my update.

@pakhontas
Copy link
Author

Yes, it would be better for LEARNING section.

@cmaglie cmaglie added the Library: EEPROM The EEPROM Arduino library label Sep 22, 2015
Chris--A added a commit to Chris--A/Arduino that referenced this issue Dec 29, 2016
@sandeepmistry sandeepmistry added the Component: Documentation Related to Arduino's documentation content label Sep 16, 2019
@per1234 per1234 added the feature request A request to make an enhancement (not a bug fix) label May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content feature request A request to make an enhancement (not a bug fix) Library: EEPROM The EEPROM Arduino library
Projects
None yet
Development

No branches or pull requests

5 participants