User manual

406
mikoBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
UART1_Write_Text(outstr)
WordToStr(hour_, outstr)
UART1_Write_Text(outstr)
WordToStr(minute_, outstr)
UART1_Write_Text(outstr)
‘--- get le size
fsize = Mmc_Fat_Get_File_Size
LongIntToStr(fsize, outstr)
UART_Write_Line(outstr)
else
‘--- le was not found - signal it
UART1_Write(0x55)
Delay_ms(1000)
UART1_Write(0x55)
end if
end sub
‘-------------- Tries to create a swap le, whose size will be at least 100
‘ sectors (see Help for details)
sub procedure M_Create_Swap_File()
dim i as word
for i=0 to 511
Buffer[i] = i
next i
size = Mmc_Fat_Get_Swap_File(5000, “mikroE.txt”, 0x20) see help on this function
for details
if (size <> 0) then
LongIntToStr(size, err_txt)
UART_Write_Line(err_txt)
for i=0 to 4999
Mmc_Write_Sector(size, Buffer)
Inc(size)
UART1_Write(“.”)
next i
end if
end sub
‘-------------- Main. Uncomment the function(s) to test the desired operation(s)
main:
err_txt = “FAT16 not found”
le_contents = “XX MMC/SD FAT16 library by Anton Rieckert#”
le_contents[41] = 10 ‘ newline
lename = “MIKRO00xTXT”
#DEFINE COMPLETE_EXAMPLE ‘ comment this line to make simpler/smaller example
PORTD = 0
TRISD = 0
PORTF = 0
TRISF = 0
ADPCFG = 0xFFFF ‘ initialize AN pins as digital