[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 574: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 630: sizeof(): Parameter must be an array or an object that implements Countable
Plum Geek Forum • individual Ringo idendification ?
Page 1 of 1

individual Ringo idendification ?

Posted: Mon Nov 30, 2015 10:20 am
by didier
Hi,
I have two Ringos on which I would like to run almost the same code.
I would prefer to have only one code file, and just modify a few lines
or parameters on each robot. I thought I could do that for example reading some
serial number/identifier on the Ringo and using an if statement
- is there already a Ringo serial number/identification which can be read from the Arduino
code (if yes how to read it) ?
- if none is built in, is it possible to use the trick of writing once a code
in the EEPROM as described in the post by HCF on this page
http://forum.arduino.cc/index.php/topic,45104.0.html
without breaking other Ringo software ? I have seen for example that
there is at least already a variable, GYROSCOPE_CALIBRATION_MULTIPLIER_DEFAULT, written
at GYRO_CAL_MULT_ADDRESS 1020 (in Navigation.h)
Are there parts of the EEPROM which can be used for this purpose without damage ?
Many thanks in advance for your advice
PS some example(s) of interaction between Ringos (or Winks) would be a nice addition to the Guide

Re: individual Ringo idendification ?

Posted: Fri Dec 04, 2015 3:39 am
by Kevin
Hello didier,

Sorry it took a while to get back to you.

You can certainly use the EEPROM. The only suggestion is that you avoid the address 1020 as that's a designated holding spot for the gyro calibration if you use it.

Whenever you upload code to Ringo, it erases the normal flash memory and over-writes it each time, but it does not erase the EEPROM - it should stay forever unless you use a more advanced programmer with options that specifically erase it.

There is no other code stored in EEPROM so you can feel free to use it for whatever you'd like. As you discovered the code to write the gyro calibration (and also to read it) you can use that as an example.

If you or anyone else needs it, the official EEPROM function reference at Arduino is here:
https://www.arduino.cc/en/Reference/EEPROMWrite

Thanks!
-Kevin