Привет, всем! Нужна помощь в организации просмотра файлов на SD карте. Рабочий код позволяет читать построчно текстовую переменную К из файла "Mach2mm.cnc" и выводить на дисплей. Но проблема в том, что нужно точно указать с какого файла читать. А мне нужно организовать прокрутку файлов на дисплее и выбор с какого читать.
$regfile = "m32def.dat" $crystal = 16000000 $hwstack = 100 $swstack = 100 $framesize = 100 $include "Config_MMCSD_HC.bas" $include "Config_AVR-DOS.BAS" Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portc.0 , Db5 = Portc.1 , Db6 = Portc.2 , Db7 = Portc.3 , E = Portc.4 , Rs = Portc.5 Cursor Off Cls Config Serialin = Buffered , Size = 20 Config Clock = Soft Enable Interrupts Config Date = Dmy , Separator = . Dim K As String * 24 Lcd "Test_Dos_Drive compiled at " ; Version() Wait 1 Cls 'Dim Btemp1 As Byte Lcd "Wait for Drive" Wait 1 Cls If Gbdriveerror = 0 Then ' Include AVR-DOS Configuration and library Lcd "Init File System ... "; Wait 1 Cls Btemp1 = Initfilesystem(1) ' Partition 1 ' use 0 for drive without Master boot record If Btemp1 <> 0 Then Lcd "Error: " ; Btemp1 ; " at Init file system" Wait 2 Cls Else Lcd " OK!" Wait 1 Cls End If Else Lcd "Error during Drive Init: " ; Lowerline Lcd Gbdriveerror Wait 2 Cls End If Do Open "Mach2mm.cnc" For Input As #1 Input #1 , K ' write is also supported 'Close #1 Lcd "Read Mach2mm.cnc" Lowerline Lcd K Waitms 200 Cls Loop End