Elektroda.pl
Elektroda.pl
X
Please add exception to AdBlock for elektroda.pl.
If you watch the ads, you support portal and users.

Menu bascom dziwne mruganie

wildchicken 06 Apr 2008 18:13 1074 4
  • #1
    wildchicken
    Level 11  
    Witam prosił bym o poprawienie mojego kodu bo gdy uruchomię program to napisy na LCD mrugają a nie swiecą stale


    Quote:
    $sim

    $regfile = "m8def.dat"



    Config Lcd = 16 * 2
    Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5

    Config Pind.2 = Input

    Hi:

    Do
    Cls
    Lcd "text1"
    Waitms 50


    If Pind.2 = 1 Then
    Gosub Menu
    End If



    Loop
    End


    Menu:


    Do
    Cls
    Lcd "text2"


    If Pind.2 = 0 Then
    Gosub Hi


    End If


    Loop
    End
  • #2
    august_a
    Level 21  
    Sprawdz tak:
    $sim 
    
    $regfile = "m8def.dat" 
    
    
    
    Config Lcd = 16 * 2 
    Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5 
    
    Config Pind.2 = Input 
    
    Hi: 
    Cls 
    Do 
    Lcd "text1" 
    Waitms 50 
    
    
    If Pind.2 = 1 Then 
    Exit Do
    End If 
    
    
    
    Loop 
    
    
    
    Menu: 
    
    Cls 
    Do 
    Lcd "text2" 
    
    
    If Pind.2 = 0 Then 
    exit do
    End If 
    
    
    Loop 
    goto hi
    End
  • #3
    wildchicken
    Level 11  
    gdy używam tego to wyswietla mi teks ciągle czyli :text2text2text2text2text2text2text2 itd.. w obu przypadkach ;;/
  • #4
    august_a
    Level 21  
    A tak:
    $sim 
    
    $regfile = "m8def.dat" 
    
    
    
    Config Lcd = 16 * 2 
    Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5 
    
    Config Pind.2 = Input 
    
    Hi: 
    
    Do 
    Cls 
    locate 1,1 : Lcd "text1" 
    Waitms 50 
    
    
    If Pind.2 = 1 Then 
    Gosub Menu 
    End If 
    
    
    
    Loop 
    End 
    
    
    Menu: 
    
    
    Do 
    Cls 
    locate 1,1 : Lcd "text2" 
    
    
    If Pind.2 = 0 Then 
    Gosub Hi 
    
    
    End If 
    
    
    Loop 
    End


    To wszystko jest w HELPie od BASCOMA.......
  • #5
    wildchicken
    Level 11  
    zrobiłem tak jak pan pisał ale dalej było to samo ale zauwarzyłem błąd
    CLS powinno być przed "DO"

    Quote:
    $sim

    $regfile = "m8def.dat"



    Config Lcd = 16 * 2
    Config Lcdpin = Pin , Db4 = Portc.3 , Db5 = Portc.2 , Db6 = Portc.1 , Db7 = Portc.0 , E = Portc.4 , Rs = Portc.5

    Config Pind.2 = Input

    Hi:
    Cls
    Do

    locate 1,1 : Lcd "text1"
    Waitms 50


    If Pind.2 = 1 Then
    Gosub Menu
    End If



    Loop
    End


    Menu:

    Cls
    Do
    Cls
    locate 1,1 : Lcd "text2"


    If Pind.2 = 0 Then
    Gosub Hi


    End If


    Loop
    End



    Aha jeszcze jedne pytanie mam czy jak zmontuje układ to jak podłącze microswitcha to jedna nożka do procesora PD2 a druga do "plusa" czy "minusa" i czy są jakieś normy którymi sie czeba kierować czy zawsze do jednego sie podłącza ?????

    Dodano po 1 [godziny] 39 [minuty]:

    temat zamkniety