- Name:
-
write
- Syntax:
-
WRITE location,data ,data, WORD wordvariable...
Location - is a variable/constant specifying a byte-wise address (0-255).
Data - is a variable/constant which provides the data byte to be written. To use a word variable the keyword WORD must be used before the wordvariable.
- Description:
-
Write byte data content into data memory.
The write command allows byte data to be written into the microcontroller's internal data memory. The contents of this memory is not lost when the power is removed. However the data is updated (with the EEPROM command specified data) upon a new download. To read the data during a program use the read command.
With the PICAXE-08, 08M, 08M2, 14M, 18, 18M and 18M2 the data memory is shared with program memory. Therefore only unused bytes may be used within a program. To establish the length of the program use 'Check Syntax' from the PICAXE menu. This will report the length of program. See the EEPROM command for more details.
When word variables are used (with the keyword WORD) the two bytes of the word are saved/retrieved in a little endian manner (ie low byte at address, high byte at address + 1)