This product is provided as downloadable without any storage media and is billed without shipping. AVR-DOS is a FAT16 and FAT32 File system for BASCOM-AVR written by Vögel Franz Josef.
MCS Electronics is the authorised reseller for this add-on library.
The library is completely written in AVR-assembler.
The AVR-DOS File system is completely integrated into the compiler
The syntax is completely the same as from QB/VB.
A small example:
Print #1 , "Init File System ... ";
Dim Gbtemp1 As Byte ' scratch byte
Gbtemp1 = Initfilesystem(1) ' we must init the
filesystem once
If Gbtemp1 > 0 Then
Print #1 , "Error " ;
Gbtemp1
Else
Print #1 , " OK"
Print "Disksize :
" ; Disksize() '
show disk size in bytes
Print "Disk free:
" ; Diskfree() '
show free space too
End If
'dim
some test variables
Dim S As String * 60 , Fl As String * 12 , Ff As Byte
Dim Sdatetime As String * 18
Fl = "test.txt"
S = "test this"
'Now
we are getting to it
'We
can specify a file handle with #1 or
#2 etc. or we can ask for a free
'
file handle with the FreeFile function. It will return a free handle if there is
one.
Ff = Freefile() '
get a file handle
'With
this file handle we refer to a file
Open Fl For Output As #ff ' open fikle for output
' we need to open a file before
we can use the file commands
' we open it for OUTPUT, INPUT , APPEND or BINARY
' In this case we open it for OUTPUT because we want to write to the file.
' If the file existed, the file would be overwritten.
Print #ff , S '
print some data
Print #ff , S
Print #ff , S
Print #ff , "A constant" ; S
Testsb Ff
Close #ff
It is simple to creata data loggers, MP3 players etc.
|