Need more space, please...


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Need again help, please, PLEASE ...

    I re-wrote the code, in attempt to having BIGGER numbers on display !
    This is the code :
    Code:
    @ DEVICE pic16F648A, INTrc_osc, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_OFF, LVP_OFF, CPD_OFF, PROTECT_OFF 
    
    Define  NO_CLRWDT 1
    DEFINE  OSC 4                            
    
            TRISB = %00011100                    'portB configuration  0=out 1=in
            TRISA = %10100000                    'portA configuration
            PortA = %11100000        
            CMCON = 7                        
            VRCON = 0                        
            INTCON = 0              
    
    OPTION_REG=%00000111                       'weak pullups on, TMRO prescale = 256     
    
     
    DQ2        VAR PORTB.3
    
                        
    RST         var  PortA.4   'pin 3   Output   reset display
    SDIN        var  PortA.3   'pin 2   Output   master data out        
    SCK         var  PortA.2   'pin 1   Output   Spi clock
    DQ          var  PortB.2   'pin 18  I/O      DQ DS18b20    
    D_C         var  PortB.0   'pin 6   Output   command/data sel. register
    
                
    Temperature     Var     Word     
    TempC           Var     Word         
    Sign            Var     Word         
    Float           Var     Word           
    Dummy           Var     Byte                  
                LcdReg          var  byte        
                x               var  byte
                y               var  byte
                z               var  byte
                Offset          var  byte
                Char            var  byte
                a               var  byte
                PosX            VAR  Byte
                PosY            VAR  Byte
                Chr             VAR  Byte
                LcdData         VAR  Byte
     Cursor          Var  Byte
    
    '-------------------------------------------------------------------------------            
        Data @0,$FC, $FE, $FE, $06, $00,_
            $00, $06, $FE, $FE, $FC,_
            $7F, $FF, $FF, $C0, $00,_
            $00, $C0, $FF, $FF, $7F,_    ; //0
               $00, $00, $18, $1C, $FE,_ 
              $FE, $FE, $00, $00, $00,_ 
            $00, $00, $00, $C0, $FF,_ 
              $FF, $FF, $C0, $00, $00,_    ; //1
               $00, $3C, $3E, $3E, $06,_
            $86, $FE, $FE, $7C, $00,_ 
            $00, $E0, $F0, $FC, $FF,_ 
            $CF, $C7, $C1, $C0, $00,_     ; //2
               $00, $1C, $1E, $9E, $86,_
             $86, $FE, $FE, $FC, $00,_
            $00, $78, $F8, $F9, $C1,_ 
            $C1, $FF, $FF, $7E, $00,_     ; //3
               $00, $00, $F0, $FE, $7E,_ 
            $FE, $FE, $FE, $00, $00,_ 
            $00, $3F, $3F, $37, $30,_
             $FF, $FF, $FF, $30, $00     ; //4
       
     Data @101, $00, $FE, $FE, $FE, $C6,_ 
                $00, $C6, $C6, $C6, $86,_ 
            $71, $F1, $F1, $C0, $00,_ 
            $00, $C0, $FF, $FF, $7F,_    ; //5
            $00, $FC, $FE, $FE, $C6,_ 
            $C6, $DE, $DE, $9C, $00,_ 
            $00, $7F, $FF, $FF, $C0,_ 
            $C0, $FF, $FF, $7F, $00,_    ; //6
            $00, $06, $06, $06, $86,_ 
            $E6, $FE, $7E, $1E, $00,_ 
            $00, $80, $F0, $FE, $3F,_ 
            $07, $01, $00, $00, $00,_    ; //7
            $00, $7C, $FE, $FE, $86,_ 
            $86, $FE, $FE, $7C, $00,_ 
            $00, $7E, $FF, $FF, $C1,_ 
            $C1, $FF, $FF, $7E, $00,_    ; //8
            $00, $FC, $FE, $FE, $86,_ 
            $86, $FE, $FE, $FC, $00,_ 
            $00, $78, $F9, $F9, $C1,_ 
            $C1, $FF, $FF, $7F, $00        ; //9
                 
    
    '-------------------------------------------------------------------------------            
                       pause 1000
                    RST = 1
                    PortB = 0
                    LcdReg  =  %00100001          'LCD Extended Commands.
                    call    PrintCtrlLcd
                    LcdReg  =  $C5                'Set LCD Vop (Contrast).
                    call    PrintCtrlLcd
                    LcdReg  =  %00000110          'Set Temp coefficent.
                    call    PrintCtrlLcd
                    LcdReg  =  %00010011          'LCD bias mode 1:48.
                    call    PrintCtrlLcd
                    LcdReg  =  %00100000          'LCD Standard Commands, Horizontal addressing mode.
                    call    PrintCtrlLcd
                    LcdReg  =  %00001100          'LCD in normal mode
                    call    PrintCtrlLcd
                       
    call CursorHome
    Gosub LCD_Clear
    
    Main:                
    ' Sensor 1
     OWOut DQ, 1, [$CC, $44] 
     OWOut DQ, 1, [$CC, $BE]
     OWIn DQ, 2, [temperature.byte0, temperature.byte1]  
    
    If Temperature.15 then       
      Temperature= ~Temperature +1
      sign="-"
    Endif
    Dummy = 625 * Temperature
    TempC = DIV32 10 
    TempC = (Temperature & $7FF) >> 4
    Float = ((Temperature.Lowbyte & $0F ) * 25 )>>2
    Temperature = TempC*100 + Float
    
    
    LcdReg  =  %10000000            ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000000            ' cursor  Y
     call    PrintCtrlLcd                      
                    Char = (temperature dig 1)     
                    Call    PrintChar
                                
    LcdReg  =  %10000000  + 5       ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000000            ' cursor  Y
     call    PrintCtrlLcd     
    
                    Char = (temperature dig 1 )+ 1    
                    Call    PrintChar
    LcdReg  =  %10000000            ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000001            ' cursor  Y
     call    PrintCtrlLcd
    
                    Char = (temperature dig 1 )+ 2   
                    Call    PrintChar
    LcdReg  =  %10000000  + 5       ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000001            ' cursor  Y
     call    PrintCtrlLcd
    
                    Char = (temperature dig 1 )+ 3   
                    Call    PrintChar
    goto Main
    
    
    '============================================================
    
    CursorHome:     LcdReg  =  %10000000            ' cursor Home
                    call    PrintCtrlLcd
                    LcdReg  =  %01000000            ' cursor Home
                    call    PrintCtrlLcd
                    return
    
    PrintChar:   offset = Char * 5          
                 
                    for a = 1 to 5                
                        read offset, LcdReg
                        call  PrintDataLcd
                        offset = offset + 1
                    next a
                    LcdReg = 0
                    call    PrintDataLcd
                    return
                                        
    PrintCtrlLcd:   D_C = 0                             
    
    PrintDataLcd:   for x = 1 to 8                
                        SDIN = LcdReg.7              
                        SCK = 1
                        LcdReg = LcdReg << 1
                        SCK = 0
                    next x               
                    D_C = 1
                    return               
                    
    Lcd_Clear:
        FOR Cursor = 0 TO 5
            PosX=0:PosY=Cursor:GOSUB Lcd_GotoXY
            HIGH D_C
            LcdData = 0
            FOR Chr = 1 TO 84
                GOSUB LCD_ByteOut
            NEXT Chr
        NEXT Cursor
    RETURN
    
    LCD_GotoXY:
      LOW D_C
      LcdData=%01000000 | PosY :GOSUB LCD_ByteOut
      LcdData=%10000000 | PosX :GOSUB LCD_ByteOut
    RETURN
    
    LCD_ByteOut:
      SHIFTOUT SDIN,SCK,1,[LcdData]
    RETURN
    Each number is made - in FastLCD- like in this example :
    Name:  how_build_number.jpg
Views: 3018
Size:  274.0 KB
    But the results are...strange, like this :
    Name:  example.jpg
Views: 2529
Size:  109.4 KB
    Please, need advice...Thanks in advance !!!
    LE : I use now 16F648A (more EEprom). Attaching ISIS simulating.
    Attached Files Attached Files

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Need more space, please...

    Based on this post : http://www.picbasic.co.uk/forum/show...7847#post87847 - Thank You, scalerebotics !!! I re-x-wrote the code. Now I have good results ! But.... HOW can I display all the three digits of var.temperature ?!? Give me a clue, please !!!
    Code:
    ;**********************************************************************************************
    ;             BIG FONTS - need improvements !!!
    
    @ DEVICE pic16F628A, INTRC_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON, LVP_OFF, CPD_OFF, PROTECT_OFF 
    
    Define  NO_CLRWDT 1
    DEFINE  OSC 4                            
    
            TRISB = %00011100                    'portB configuration  0=out 1=in
            TRISA = %10100000                    'portA configuration
            PortA = %11100000        
            CMCON = 7                        
            VRCON = 0                        
            INTCON = 0              
    
    OPTION_REG=%00000111                       'weak pullups on, TMRO prescale = 256
                                                    
    Lcd_DC      var PortB.0 
    Lcd_SDA     var PortA.3
    Lcd_RST     var PortA.4
    Lcd_CLK     var PortA.2
    DQ          var PortB.2   
    
    
    
    i           var Byte
    j           var Word
    k           var Byte
    Nc          var Byte
    PosX        var Byte
    PosY        var Byte
    LcdStr      var Byte [28]
    Lcd_Data    var Byte
    CharNum     var Byte
    FA VAR BYTE[5] 'upper left of character
    FB VAR BYTE[5] 'upper right of character
    FC VAR BYTE[5] 'lower left of character
    FD VAR BYTE[5] 'lower right of character
    LcdReg          var  Byte        
    x               var  Byte
    y               var  Byte        
    cursor          var  Byte
    
    Temperature     Var     Word     
    TempC           Var     Word         
    Sign            Var     Word         
    Float           Var     Word                
    Dummy           Var     Byte                       
    DS18B20_12bit    CON %01111111       ' 750ms,   0.0625°C 
    
    
    
    'initialize display-----------------------------------------------
    pause 250
    '-----------------------------------------------------------------
    
                                                    'Initialize LCD, run 1st this!                 
        Low Lcd_RST                                 'Reset LCD (HW reset)
        pause 100 
        High Lcd_RST                                'Release Reset
        Low Lcd_DC                                  'Command/Data
         
      Lcd_Data= $21: GOSUB Lcd_SentByte       ' LCD EXTENDED COMMANDS
      Lcd_Data= $c2: GOSUB Lcd_SentByte       ' SET LCD Vop (CONTRAST) era c8
      Lcd_Data= $06: GOSUB Lcd_SentByte       ' SET TEMP COEFFICENT
      Lcd_Data= $13: GOSUB Lcd_Sentbyte       ' LCD BIAS MODE
      Lcd_Data= $20: GOSUB Lcd_Sentbyte       ' LCD STANDARD COMMANDS
      Lcd_Data= $09: GOSUB Lcd_Sentbyte       ; all on
       pause 1000
      Lcd_data= $08: gosub lcd_sentbyte       ' lcd blank
      Lcd_Data= $0c: GOSUB Lcd_sentbyte       ' LCD IN NORMAL MODE
    
    gosub Lcd_Clear                     'Clear contents of screen
    Low Lcd_DC
    
    Pause 100
    
    
    '==================================================
    ' Init Sensor 1
     OWOUT DQ, 1, [$CC, $4E, 0, 0, DS18B20_12bit]
     OWOut DQ, 1, [$CC, $48]                   ' Start temperature conversion
     OWOut DQ, 1, [$CC, $B8] 
     OWOut DQ, 1, [$CC, $BE] 
     Pause 50
     OWIn DQ, 2, [temperature.byte0, temperature.byte1]
    
    '==================================================
    main:
    
    pause 100
    sign = " "
    ' Start temp.conv.Sensor1
     OWOut DQ, 1, [$CC, $44] 
     OWOut DQ, 1, [$CC, $BE]
     OWIn DQ, 2, [temperature.byte0, temperature.byte1]  
    
    If Temperature.15 then       
      Temperature= ~Temperature +1
      sign="-"
    Endif
     
    Dummy = 625 * Temperature
    TempC = DIV32 10 
    TempC = (Temperature & $7FF) >> 4
    Float = ((Temperature.Lowbyte & $0F ) * 25 )>>2
    Temperature = TempC*100 + Float
    
    
    LcdStr(2) = 48 + TEMPERATURE dig 1
    LcdStr(1) = 48 + TEMPERATURE dig 2
    LcdStr(0) = 48 + TEMPERATURE dig 3
    
    Nc=2
    
    Gosub Lcd_SentString
    gosub afisare
    goto main
    
    '==================================================
    afisare:
        High Lcd_DC
    LcdReg  =  %10000000            ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000000            ' cursor  Y
     call    PrintCtrlLcd 
        SHiftOUT Lcd_SDA , Lcd_CLK , 1, [ FA(0),FA(1),FA(2),FA(3),FA(4)] 'upper left
      
    
    LcdReg  =  %10000000  + 5          ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000000            ' cursor  Y
     call    PrintCtrlLcd  
        SHiftOUT Lcd_SDA , Lcd_CLK , 1, [ FB(0),FB(1),FB(2),FB(3),FB(4)] 'upper right
    
    
    
    LcdReg  =  %10000000            ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000001            ' cursor  Y
     call    PrintCtrlLcd
        SHiftOUT Lcd_SDA , Lcd_CLK , 1, [ FC(0),FC(1),FC(2),FC(3),FC(4)] 'lower left
    
    
    LcdReg  =  %10000000  + 5          ' cursor  X  
     call    PrintCtrlLcd
    LcdReg  =  %01000001            ' cursor  Y
     call    PrintCtrlLcd
        SHiftOUT Lcd_SDA , Lcd_CLK , 1, [ FD(0),FD(1),FD(2),FD(3),FD(4)] 'lower right
        Low Lcd_DC
        Return
    '==================================================
    Lcd_Clear:
    For cursor = 0 to 5
        PosX=0:PosY=Cursor:Gosub Lcd_GotoXY
        High Lcd_DC
    
        For i= 1 to 84
              Lcd_Data=0:Gosub Lcd_SentByte
              Lcd_Data=0:Gosub Lcd_SentByte
        Next i
    Next cursor
    Return
    
    '==================================================
    Lcd_GotoXY:
    Low Lcd_DC
    Lcd_Data=%01000000 | PosY :Gosub Lcd_SentByte    'Y
    Lcd_Data=%10000000 | PosX :Gosub Lcd_SentByte    'X
    Return
    '==================================================
    Lcd_SentByte:
    SHiftOUT Lcd_SDA , Lcd_CLK , 1, [ Lcd_Data ]
    Return
    '==================================================
    Lcd_SentString:
    ;For k=0 to Nc-1      
    FOR K=0 TO NC
        Lcd_Data=LcdStr(k)
        Gosub Lcd_SentChar
    next k
    Return
    '==================================================
    Lcd_SentChar:
        lookdown Lcd_data,[" !\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"],CharNum
        Lcd_data = CharNum + 32
        
        SELECT CASE lcd_data
    
        Case 48 ' a zero                   
            FA(0)=$00:FA(1)=$FC:FA(2)=$FE:FA(3)=$FE:FA(4)=$06 ' // 0
            FB(0)=$06:FB(1)=$FE:FB(2)=$FE:FB(3)=$FC:FB(4)=$00 ' // 0  
            FC(0)=$00:FC(1)=$7F:FC(2)=$FF:FC(3)=$FF:FC(4)=$C0 ' // 0
            FD(0)=$C0:FD(1)=$FF:FD(2)=$FF:FD(3)=$7F:FD(4)=$00 ' // 0                    
        
        Case 49 ' a one                 
            FA(0)=$00:FA(1)=$00:FA(2)=$18:FA(3)=$1C:FA(4)=$FE ' // 1
            FB(0)=$FE:FB(1)=$FE:FB(2)=$00:FB(3)=$00:FB(4)=$00 ' // 1  
            FC(0)=$00:FC(1)=$00:FC(2)=$00:FC(3)=$C0:FC(4)=$FF ' // 1
            FD(0)=$FF:FD(1)=$FF:FD(2)=$C0:FD(3)=$00:FD(4)=$00 ' // 1  
    
        Case 50 ' a TWO                 
            FA(0)=$00:FA(1)=$3C:FA(2)=$3E:FA(3)=$3E:FA(4)=$06 ' // 2
            FB(0)=$86:FB(1)=$FE:FB(2)=$FE:FB(3)=$7C:FB(4)=$00 ' // 2  
            FC(0)=$00:FC(1)=$E0:FC(2)=$F0:FC(3)=$FC:FC(4)=$FF ' // 2
            FD(0)=$CF:FD(1)=$C7:FD(2)=$C1:FD(3)=$C0:FD(4)=$00 ' // 2 
    
        Case 51 ' a THREE                 
            FA(0)=$00:FA(1)=$1C:FA(2)=$1E:FA(3)=$9E:FA(4)=$86 ' // 3
            FB(0)=$86:FB(1)=$FE:FB(2)=$FE:FB(3)=$FC:FB(4)=$00 ' // 3  
            FC(0)=$00:FC(1)=$78:FC(2)=$F8:FC(3)=$F9:FC(4)=$C1 ' // 3
            FD(0)=$C1:FD(1)=$FF:FD(2)=$FF:FD(3)=$7E:FD(4)=$00 ' // 3
    
        Case 52 ' a FOUR                 
            FA(0)=$00:FA(1)=$00:FA(2)=$F0:FA(3)=$FE:FA(4)=$7E ' // 4
            FB(0)=$FE:FB(1)=$FE:FB(2)=$FE:FB(3)=$00:FB(4)=$00 ' // 4  
            FC(0)=$00:FC(1)=$3F:FC(2)=$3F:FC(3)=$37:FC(4)=$30 ' // 4
            FD(0)=$FF:FD(1)=$FF:FD(2)=$FF:FD(3)=$30:FD(4)=$00 ' // 4
    
        Case 53 ' a FIVE                 
            FA(0)=$00:FA(1)=$FE:FA(2)=$FE:FA(3)=$FE:FA(4)=$C6 ' // 5
            FB(0)=$C6:FB(1)=$C6:FB(2)=$C6:FB(3)=$86:FB(4)=$00 ' // 5  
            FC(0)=$00:FC(1)=$71:FC(2)=$F1:FC(3)=$F1:FC(4)=$C0 ' // 5
            FD(0)=$C0:FD(1)=$FF:FD(2)=$FF:FD(3)=$7F:FD(4)=$00 ' // 5
    
        Case 54 ' a SIX                 
            FA(0)=$00:FA(1)=$FC:FA(2)=$FE:FA(3)=$FE:FA(4)=$C6 ' // 6
            FB(0)=$C6:FB(1)=$DE:FB(2)=$DE:FB(3)=$9C:FB(4)=$00 ' // 6  
            FC(0)=$00:FC(1)=$7F:FC(2)=$FF:FC(3)=$FF:FC(4)=$C0 ' // 6
            FD(0)=$C0:FD(1)=$FF:FD(2)=$FF:FD(3)=$7F:FD(4)=$00 ' // 6
    
        Case 55 ' a SEVEN                 
            FA(0)=$00:FA(1)=$06:FA(2)=$06:FA(3)=$06:FA(4)=$86 ' // 7
            FB(0)=$E6:FB(1)=$FE:FB(2)=$7E:FB(3)=$1E:FB(4)=$00 ' // 7  
            FC(0)=$00:FC(1)=$80:FC(2)=$F0:FC(3)=$FE:FC(4)=$3F ' // 7
            FD(0)=$07:FD(1)=$01:FD(2)=$00:FD(3)=$00:FD(4)=$00 ' // 7
    
        Case 56 ' a EIGHT                 
            FA(0)=$00:FA(1)=$7C:FA(2)=$FE:FA(3)=$FE:FA(4)=$86 ' // 8
            FB(0)=$86:FB(1)=$FE:FB(2)=$FE:FB(3)=$7C:FB(4)=$00 ' // 8  
            FC(0)=$00:FC(1)=$7E:FC(2)=$FF:FC(3)=$FF:FC(4)=$C1 ' // 8
            FD(0)=$C1:FD(1)=$FF:FD(2)=$FF:FD(3)=$7E:FD(4)=$00 ' // 8
    
        Case 57 ' a NINE                 
            FA(0)=$00:FA(1)=$FC:FA(2)=$FE:FA(3)=$FE:FA(4)=$86 ' // 9
            FB(0)=$86:FB(1)=$FE:FB(2)=$FE:FB(3)=$FC:FB(4)=$00 ' // 9  
            FC(0)=$00:FC(1)=$78:FC(2)=$F9:FC(3)=$F9:FC(4)=$C1 ' // 9
            FD(0)=$C1:FD(1)=$FF:FD(2)=$FF:FD(3)=$7F:FD(4)=$00 ' // 9
    
        end SELECT
    
    High Lcd_DC
    
    PrintCtrlLcd:   LCD_DC = 0                             
    
    PrintDataLcd:   for x = 1 to 8                
                        LCD_SDA = LcdReg.7              
                        LCD_CLK = 1
                        LcdReg = LcdReg << 1
                        LCD_CLK = 0
                    next x               
                    LCD_DC = 1
                    return     
    END
    Now I have only dig 1 on display ....

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    I have good results !
    Attached Images Attached Images  
    Attached Files Attached Files

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Me, again...

    Hope not disturb !
    This is my last variant of dual thermometer.
    Attached Images Attached Images     
    Attached Files Attached Files
    Last edited by fratello; - 1st June 2011 at 19:30. Reason: ...maybe someone want the code...

  5. #5
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,158


    Did you find this post helpful? Yes | No

    Default Re: Me, again...

    Quote Originally Posted by fratello View Post
    Hope not disturb !
    This is my last variant of dual thermometer.

    Fratello,

    This is your thread.

    You can post anything you consider relevant to this subject; more info on components, ideas about schematic, or more questions on code.

    And congratulations on achieving your objectives!
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  6. #6
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Me, again...

    Thank You so much for support !
    ...another fonts...
    Attached Images Attached Images   
    Attached Files Attached Files

  7. #7
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: Need more space, please...

    Instead :
    Code:
    BorderLine:                         ' 
    '=================================== RAND 0
                     for y = 0 to 83 
                     call setcursor
                     read y, LcdReg                      
                     call    PrintDataLcd                
                     next y
    '===================================  RAND 1                                
                   LcdReg  =  %10000000                      ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000001                ' cursor  Y
                   call    PrintCtrlLcd 
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd     
                   
                    LcdReg  =  %10000000 + 83                ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000001                ' cursor  Y
                   call    PrintCtrlLcd 
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd  
    '===================================  RAND 2
                    LcdReg  =  %10000000                ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000010                ' cursor  Y
                   call    PrintCtrlLcd    
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd
                                   
                    LcdReg  =  %10000000 + 83               ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000010                ' cursor  Y
                   call    PrintCtrlLcd
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd
    
    '===================================  RAND 3
                    LcdReg  =  %10000000                ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000011                ' cursor  Y
                   call    PrintCtrlLcd
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd
                   
                   LcdReg  =  %10000000 + 83                ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000011                ' cursor  Y
                   call    PrintCtrlLcd
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd   
    '===================================  RAND 4                
                   LcdReg  =  %10000000                      ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000100                ' cursor  Y
                   call    PrintCtrlLcd 
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd     
                   
                    LcdReg  =  %10000000 + 83                ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000100                ' cursor  Y
                   call    PrintCtrlLcd 
                   LOokup 0, [$FF] , LcdReg 
                   call    PrintDataLcd    
    '===================================  JOS                
            LcdReg  =  %10000000                      ' cursor  X  
                    call    PrintCtrlLcd
                    LcdReg  =  %01000101                  ' cursor  Y
                    call    PrintCtrlLcd
                    for y = 0 to 83                   
      LOokup y, [$FF,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,_             
               $80,$80,$80,$80,$81,$81,$81,$BF,$BF,$BF,$81,$81,$81,$80,$BF,$BF,$BF,$A9,_          
               $A9,$A9,$A1,$80,$BF,$BF,$BF,$89,$89,$99,$A6,$80,$BF,$BF,$BF,$82,_          
               $84,$82,$BF,$BF,$BF,$80,$9E,$BF,$BF,$A1,$A1,$BF,$BF,$9E,$80,_          
               $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,_          
               $80,$80,$80,$80,$FF] ,LcdReg
                    call    PrintDataLcd
                    next y 
    return
    I use now :
    Code:
    GotoXY:                
    LcdReg = %01000000 | Posy : call    PrintCtrlLcd    'Y
    LcdReg = %10000000 | Posx : call    PrintCtrlLcd    'X
    Return
    '=========================== 
    BorderLine:                         ' 
    '=================================== up
    posx=0
    posy=0
    gosub GotoXY
                     for y = 0 to 83 
                     read y, LcdReg                      
                     call    PrintDataLcd                
                     next y
    '===================================  raw all                               
    for i= 1 to 4
    posx=0
    posy=i
    gosub GotoXY
                   lcdReg= $FF
                   call    PrintDataLcd
    next i
    
    for i = 1 to 4
    posx=83
    posy=i
    gosub GotoXY
                   lcdReg= $FF
                   call    PrintDataLcd
    next i    
    '===================================  JOS                
    posx=0
    posy=5
    gosub GotoXY
                    for y = 0 to 83                   
        LOokup y,  [$FF,$80,$81,$81,$BF,$BF,$BF,$81,$81,$80,$BF,$BF,_
    $BF,$A9,$A9,$A9,$80,$BF,$BF,$BF,$89,$89,$99,$A6,$80,$BF,$BF,$BF,_
    $82,$84,$82,$BF,$BF,$BF,$80,$9E,$BF,$BF,$A1,$BF,$BF,$9E,$80,$80,_
    $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,_
    $80,$80,$80,$80,$80,$9C,$A2,$A2,$A2,$9C,$80,$9E,$A0,$A0,$A0,$9E,_
    $80,$82,$82,$BE,$82,$82,$80,$FF] ,LcdReg
                    call    PrintDataLcd
                    next y 
    return
    I attach the code from termometer with two differents fonts : small and big. Enjoy !
    Attached Files Attached Files

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts