Page 1 of 1

Arduino EEPROM working???

Posted: Sat Feb 27, 2016 10:15 pm
by 407charles
I'm having problems with the Arduino eeprom. I made a program to write names to create a name list and stored on EEPROM, also the program should show the list if is required. I'm not saying that my program is perfect but it looks like the eeprom component it's not writing to or reading from eeprom. I could be also making a mistake on my programming but I can not see it. During the run time of the program I'm monitoring ptr which is my eeprom memory address and it increments and decrements as needed but the read/write commands seem to not be operating. Also I tried with hardware and it's not working at all. It looses all data during reset. Please, I need help with this issue. All help is greatly appreciated.

Re: Arduino EEPROM working???

Posted: Sun Feb 28, 2016 5:12 pm
by acestu
Hi Charles,

Can you post your chart please and somebody will be able to help you better.

Thanks
Stuart

Re: Arduino EEPROM working???

Posted: Sun Feb 28, 2016 5:17 pm
by 407charles
Thanks a lot. I already found the problem. It was on my programing (component set up).
Best regards.

Re: Arduino EEPROM working???

Posted: Sun Feb 28, 2016 5:50 pm
by acestu
Hi Charles,

Glad to see you have sorted it out.

Stuart

Re: Arduino EEPROM working???

Posted: Mon Feb 29, 2016 11:57 am
by Benj
Hello,

Glad you have the problem resolved.

The Console window works with the EEPROM component to show you the values when simulating. This may help you to troubleshoot any future programs involving EE memory.

Re: Arduino EEPROM working???

Posted: Tue Mar 15, 2016 4:05 pm
by 407charles
Yes, It's how I was able to find my mistake. I found another example at the forum and that's how I did check this feature. Let me ask you a question, I have seen examples of macros with and without returned variable and they both work. I would like to know the difference in between both, so I can take the advantage of using it at the right application. Could you please explain? I appreciate your time. Thanks a lot for your support.

Re: Arduino EEPROM working???

Posted: Thu Mar 17, 2016 11:39 am
by Benj
Hello,

A macro can have parameters which are values passed into a macro and a return which is a value passed back from the macro.

In smaller or simpler programs you might use global variables in your program in which case the macros can all access the same variables and no parameters or returns are necessary.

However as the program gets more complex the global variables can cause problems in that they are always taking up space in memory and anything can change or edit their value meaning tracking down a bug can become very tricky.

The use of parameters and returns and other local variables allows the variables to only exist while you are inside the macro which can create space for other variables when you leave the macro. It also makes the system more straightforward and allows for much easier debugging of large complex programs. A final point is that they make the program more modular which allows you to cut and paste sections of code by exporting and importing macros.

The Flowcode components are great examples of this copy paste modular approach.

Re: Arduino EEPROM working???

Posted: Fri Mar 18, 2016 7:26 pm
by 407charles
I got it. I really appreciate your help. Thanks for your support.