Koda: |
$regfile = "m8def.dat" $crystal = 4000000 Dim Wtime As Byte Dim Stevec As Integer Dim Dolzina As Single Cha Alias Pind.2 Chb Alias Pind.3 Config Cha = Input Config Chb = Input Const Debouncetime = 1 Config Int0 = Falling Enable Interrupts Enable Int0 On Int0 Enkoder Config Lcdbus = 4 Config Lcd = 20 * 4 Initlcd Cursor Off Noblink Wtime = 10 Stevec = 0 Set Chb 'LCD zaslon Config Lcdpin = Pin , Db7 = Portb.0 , Db6 = Portb.1 , Db5 = Portb.2 , Db4 = Portb.3 , E = Portb.4 , Rs = Portb.5 '/////////////// * Glavna zanka * ///////////////// Do Waitms Wtime Locate 1 , 1 : Lcd Dolzina Waitms Wtime Loop End '/////////////////////////////////////////////////// Enkoder: If Cha = 0 Then If Chb = 0 Then Incr Stevec Else Decr Stevec End If ' Tukaj precuna v mm. 1 obrat je 5 mm pomika Dolzina = Stevec * 0.05 Return |
Vlado je napisal/a: |
Marko,
kakšne so vrednosti za stack? Ker tega nimaš v programu, predvidevam da imaš privzete vrednosti (Options ->Compiler->Chip). Preveri vrednosti in jih povečaj. Priporočam da to vpišeš na začetku programa (tako bodo te vrednosti vedno enake za ta program). Kar se tiče single, pa uporabi ukaz: Config Single = Scientific , Digits = 2 LP |
Koda: |
$hwstack = 128 $swstack = 128 $framesize = 128 |
Citiram: |
Waitms Wtime
Locate 1 , 1 : Lcd Dolzina Waitms Wtime |