Difference between revisions of "Mixly Block Category - Storage"
(→Write File with Data onto SD Card) |
(→Write a Long) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | =Write File | + | =SD= |
+ | ==Write Data to a File on the SD Card== | ||
This block writes data to a file on the SD card when using the [[SD module]]. | This block writes data to a file on the SD card when using the [[SD module]]. | ||
Line 15: | Line 16: | ||
Read more here: https://www.arduino.cc/en/reference/SD , https://www.arduino.cc/en/Reference/SDopen , https://www.arduino.cc/en/Reference/FilePrint | Read more here: https://www.arduino.cc/en/reference/SD , https://www.arduino.cc/en/Reference/SDopen , https://www.arduino.cc/en/Reference/FilePrint | ||
− | =Write a Byte to EEPROM= | + | =EEPROM= |
− | =Read a Byte from EEPROM= | + | EEPROM is a memory on the Microduino Core modules which can be used as storage for data. Data stored in the EEPROM will be preserved even if the power is turned off and can be retrieved. |
− | =Write a Long to EEPROM= | + | |
− | =Read a Long to EEPROM | + | |
+ | Read more here: https://www.arduino.cc/en/Reference/EEPROM | ||
+ | ==Write a Byte== | ||
+ | This block writes data (1 byte) to the address on the EEPROM. | ||
+ | *Address - The location to write the '''Data''' to. | ||
+ | *Data - 1 byte, which will be written to the EEPROM at '''Address'''. | ||
+ | |||
+ | |||
+ | Read more here: https://www.arduino.cc/en/Reference/EEPROMWrite | ||
+ | ==Read a Byte== | ||
+ | This block reads and returns data (1 byte) from the address on the EEPROM. | ||
+ | *Address - The location to read data from the EEPROM. | ||
+ | |||
+ | |||
+ | Read more here: https://www.arduino.cc/en/Reference/EEPROMRead | ||
+ | ==Write a Long== | ||
+ | This block writes data (1 long datatype) to the address on the EEPROM. | ||
+ | *Address - The location to write the '''Data''' to. | ||
+ | *Data - 1 long datatype, which will be written to the EEPROM at '''Address'''. | ||
+ | '''Note:''' 1 long is equal to 4 bytes. Therefore, the next available EEPROM address will be +4. i.e. | ||
+ | |||
+ | If writing a long to EEPROM address 0, then the long will consume 4 spots (0 to 3). The next free spot will be address 4. Writing to address 1-3 will overwrite a part of the long. | ||
+ | |||
+ | ==Read a Long== | ||
+ | This block reads and returns data (1 long datatype) from the address on the EEPROM. | ||
+ | *Address - The location to read data from the EEPROM. |
Latest revision as of 01:35, 23 February 2017
Contents
SD
Write Data to a File on the SD Card
This block writes data to a file on the SD card when using the SD module.
Below are the steps that occurs:
- Opens a file on the SD card. If the file is opened for writing, it will be created if it doesn't already exist (but the directory containing it must already exist).
- Print data to the file. Optionally, a new line (return) is appended after the data if NewLine is true.
The inputs are as follows:
- Filename - The name of the file to open in the SD card which will be written to.
- Data - The data that will be written to the end of the opened file.
- NewLine (boolean) - True, will append a Newline (return) to end of Data. False, will skip appending a Newline to the end of Data.
Read more here: https://www.arduino.cc/en/reference/SD , https://www.arduino.cc/en/Reference/SDopen , https://www.arduino.cc/en/Reference/FilePrint
EEPROM
EEPROM is a memory on the Microduino Core modules which can be used as storage for data. Data stored in the EEPROM will be preserved even if the power is turned off and can be retrieved.
Read more here: https://www.arduino.cc/en/Reference/EEPROM
Write a Byte
This block writes data (1 byte) to the address on the EEPROM.
- Address - The location to write the Data to.
- Data - 1 byte, which will be written to the EEPROM at Address.
Read more here: https://www.arduino.cc/en/Reference/EEPROMWrite
Read a Byte
This block reads and returns data (1 byte) from the address on the EEPROM.
- Address - The location to read data from the EEPROM.
Read more here: https://www.arduino.cc/en/Reference/EEPROMRead
Write a Long
This block writes data (1 long datatype) to the address on the EEPROM.
- Address - The location to write the Data to.
- Data - 1 long datatype, which will be written to the EEPROM at Address.
Note: 1 long is equal to 4 bytes. Therefore, the next available EEPROM address will be +4. i.e.
If writing a long to EEPROM address 0, then the long will consume 4 spots (0 to 3). The next free spot will be address 4. Writing to address 1-3 will overwrite a part of the long.
Read a Long
This block reads and returns data (1 long datatype) from the address on the EEPROM.
- Address - The location to read data from the EEPROM.