<!-- --------------------------------- -->
<a name="EE_UnLinked"></a>
&nbsp;UnLinked Variables

Unlinked EE variables, are not linked to any PBP variables, but can allow greater freedom in how you handle them.

They allow you to create meaningfull names to represent EEPROM locations. &nbsp;And, those locations can have default values, just like the Linked EE_Vars.

<a href="http://www.picbasic.co.uk/forum/showthread.php?t=2444#EE_index">up to index</a>
_________________________________
<a name="EE_byte"></a>&nbsp;EE_byte

<pre>@ EE_byte Name, Value</pre>Define a BYTE sized location in EEPROM, with a Unique name, and default value.
Name - A unique Name to identify this EE variable.

Value - The "default" value associated with this variable. This constant will be initialized in EEPROM on the first "RUN" after programming. It can also be restored at any time with the <pre>@ EE_write Name, default</pre> command.
Example:
<pre>@ EE_byte Version, 1<br>@ EE_byte VersionMinor, 0</pre>
<a href="http://www.picbasic.co.uk/forum/showthread.php?t=2444#EE_index">up to index</a>
_________________________________
<a name="EE_word"></a>&nbsp;EE_word

<pre>@ EE_word Name, Value</pre>Define a WORD sized location in EEPROM, with a Unique name, and default value.
Name - A unique Name to identify this EE variable.

Value - The "default" value associated with this variable. This constant will be initialized in EEPROM on the first "RUN" after programming. It can also be restored at any time with the "@&nbsp; EE_write&nbsp;&nbsp; Name, default" command.
Example:
<pre>@ EE_word Speed, 1100<br>@ EE_word PWMfreq, 20000</pre>
<a href="http://www.picbasic.co.uk/forum/showthread.php?t=2444#EE_index">up to index</a>
_________________________________
<a name="EE_read"></a>&nbsp;EE_read

<pre>@ EE_read Name, Variable</pre>
Name - A Name that was previously defined using either EE_byte or EE_word.

Variable - The <a href="http://www.picbasic.co.uk/forum/showthread.php?t=2444#notes">PBP variable</a> that will receive the value from EEPROM.

Note: The variable must be the same size as the EE Variable you are using. If it was defined with EE_word, and you supply EE_read with a byte sized variable, another variable will be overwritten with the High byte of the word.
Example:
<pre>Mspeed VAR WORD
@ EE_read Speed, _Mspeed

Version VAR BYTE
@ EE_read Version, _Version</pre>
<a href="http://www.picbasic.co.uk/forum/showthread.php?t=2444#EE_index">up to index</a>
_________________________________
<a name="EE_write"></a>&nbsp;EE_write

<pre>@ EE_write Name, Variable</pre>
Name - A Name that was previously defined using either EE_byte or EE_word.

Variable - The <a href="http://www.picbasic.co.uk/forum/showthread.php?t=2444#notes">PBP variable</a> that holds the value to be written to EEPROM. OR, the word "default"

Note: The variable must be the same size as the EE Variable you are using. If it was defined with EE_word, and you supply EE_write with a byte sized variable, 1 garbage byte from another variable will be written to EEPROM.
Example:
<pre>Mspeed = 2000<br>@ EE_write Speed, _Mspeed
Version = 2<br>@ EE_write Version, _Version</pre>
<a href="http://www.picbasic.co.uk/forum/showthread.php?t=2444#EE_index">up to index</a>