Difference between revisions of "Component: FAT Dummy (File)"
Line 123: | Line 123: | ||
Example showing how to steam out .wav audio files from an SD card using a 16-bit @ 16KHz file format. A free program such as Audacity can be used to create or edit the .wav files. | Example showing how to steam out .wav audio files from an SD card using a 16-bit @ 16KHz file format. A free program such as Audacity can be used to create or edit the .wav files. | ||
{{Fcfile|WAV_Streaming.fcfx|WAV Streaming}} | {{Fcfile|WAV_Streaming.fcfx|WAV Streaming}} | ||
+ | |||
+ | |||
Line 128: | Line 130: | ||
==Macro reference== | ==Macro reference== | ||
+ | ===MoveToNextFileSector=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 146: | Line 149: | ||
+ | ===WriteByteToBuffer=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 169: | Line 173: | ||
+ | ===AppendByteToFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 187: | Line 192: | ||
+ | ===CloseFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 200: | Line 206: | ||
+ | ===ReadByteFromFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 213: | Line 220: | ||
+ | ===ReadByteFromIndex=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 231: | Line 239: | ||
+ | ===DeleteFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 249: | Line 258: | ||
+ | ===CreateFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 267: | Line 277: | ||
+ | ===OpenFolder=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 285: | Line 296: | ||
+ | ===ReadFileLength=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 298: | Line 310: | ||
+ | ===OpenFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 316: | Line 329: | ||
+ | ===WriteFileSector=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 329: | Line 343: | ||
+ | ===AppendStringToFile=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Line 347: | Line 362: | ||
+ | ===ReadFileSize=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- |
Revision as of 11:49, 3 February 2023
Author | Matrix Ltd. |
Version | 2.7 |
Category | File |
Contents
FAT Dummy component
FAT component allowing access to read and write files on a SD, SDHC or MMC card. The component automatically detects the filesystem on the card on initialise so FAT16 and FAT32 are fully supported.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_File_Dummy.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_File_Dummy.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Reading data from a text file
Example to read a text file from a SD card or from a text file in simulation and display on a 16 x 2 character LCD. The text file needs to be in the same directory as the Flowcode .fcfx project file for the simulation to run correctly.
FAT Read File
File:Test.txt
Console showing current 512 byte sector data
Console showing high level FAT status
Parsing a standard .BMP image file
Example to read a bitmap image file from a SD card or from a bitmap file in simulation and display on a graphical LCD. The bitmapfile needs to be in the same directory as the Flowcode .fcfx project file for the simulation to run correctly.
FAT display Bitmap
Demo bitmap files referenced in the example.
Picture showing a bitmap being displayed on a GLCD component.
Data logger Simple
Example showing how to take a collection of analogue readings and save them into a text based file, the simple way.
FAT data logger simple but slow
Data logger Advanced
Example showing how to take a collection of analogue readings and save them into a text based file, the fast way.
FAT data logger fast
Log Keypad Presses
Example showing how to poll a keypad for key presses. Each key press is shown on an LCD and appended to a log file as an ASCII character using the FAT component.
Keypad Press Log
Streaming Audio Files
Example showing how to steam out .wav audio files from an SD card using a 16-bit @ 16KHz file format. A free program such as Audacity can be used to create or edit the .wav files.
WAV Streaming
Macro reference
MoveToNextFileSector
WriteByteToBuffer
![]() |
WriteByteToBuffer |
![]() |
Address |
![]() |
Data |
![]() |
Return |
AppendByteToFile
![]() |
AppendByteToFile |
![]() |
Data |
![]() |
Return |
CloseFile
![]() |
CloseFile |
![]() |
Return |
ReadByteFromFile
ReadByteFromIndex
![]() |
ReadByteFromIndex |
Reads a byte of data from the local sector buffer. Return = Data byte read from the local sector buffer. | |
![]() |
Address |
![]() |
Return |
DeleteFile
![]() |
DeleteFile |
![]() |
Filename |
![]() |
Return |
CreateFile
![]() |
CreateFile |
![]() |
Filename |
![]() |
Return |
OpenFolder
![]() |
OpenFolder |
![]() |
Folder_Name |
![]() |
Return |
ReadFileLength
OpenFile
WriteFileSector
![]() |
WriteFileSector |
![]() |
Return |
AppendStringToFile
![]() |
AppendStringToFile |
![]() |
Data_String |
![]() |
Return |
ReadFileSize
![]() |
ReadFileSize |
Reads the entire size of the current file in bytes. | |
![]() |
Return |
Property reference
![]() |
Properties |