News:

;) This forum is the property of Proton software developers

Main Menu

Universal Graphic Library

Started by atomix, Mar 09, 2022, 05:05 PM

Previous topic - Next topic

Pepe

Atomix still not working for fonts that are not transparent

atomix


Pepe

Device = 18F26K22
Declare Xtal = 64
Declare Create_Coff On

Include "Lib\OSC.inc"

$define LCD_USE_TFT_180_128_160         ' This adds a table for the specified display in the code.

$define LCD_User_Width    132           ' If the display resolution in the table does not suit you, you can specify your user value.
$define LCD_User_Height   162           ' If the display resolution in the table does not suit you, you can specify your user value.

$define LCD_RST     PORTC.1
$define LCD_CS      PORTC.0
$define LCD_DC      PORTC.2
$define LCD_CLK     PORTC.4
$define LCD_DAT     PORTC.3

Include "Lib\LCD\LCD_GFX.inc"
Include "Lib\LCD\Font\Std_5x8.inc"
Include "Lib\LCD\Font\Bitmap_17x17.inc"

LCD_Select(LCD_TFT_180_128_160)         ' Specifies what table to use. Without this, there will be no work in the real device.

LCD_Init()

LCD_Rotation(2)

High LATC.5                             ' for measure time of full ñleaning display

main:
    LATC.5 = 0
    LCD_Clear()
    LATC.5 = 1
       
    LCD_Color = WHITE

    LCD_Line(-108,78,236,78)
    LCD_Line(66,-108,66,236)
    LCD_Line(-30,-40,160,200)
    LCD_Line(180,-80,0,170)


    Dim sb1 As SByte = -1
    LCD_SetFont(Std_5x8)
    LCD_TextColor( YELLOW, YELLOW )
    Print At 10,20, "roll:", SDec2 sb1

    LCD_TextColor( YELLOW, BLUE )
    LCD_Bitmap(Bitmap_17x17, False)
    LCD_Bitmap(Bitmap_17x17, True)

    DelayMS 1000
GoTo main

atomix

New Release.

All fixed.

Pepe

Thanks Atomix, now it works fine and fast.

joesaliba

Thanks Atomix, a great improvement, though, I can only say that for an ST7735.

Thanks goes also to Pepe for his support and help.

One thing I would suggest is a small write up how to use various commands.

For example: - LCD_Zoom, for what it is?

What LCD's are supported. Now I know that: -

LCD_Select(LCD_TFT_180_128_160)
is for a 128 x 160 ST7735 LCD, etc...

In any way, great work.

Thank you

Joe

Pepe

#46
Atomix could give an example of configuration for ssd1306 132x64.

atomix

LCD_Zoom - Sets the scale zoom to font (in order to save flash memory and use one font).

Supported Displays can be seen in files - LCD_MONO_DRV.inc and LCD_TFT_DRV.inc

An example of display declarations can be seen in the file - example.inc

To Pepe: attached an example.

Pepe

Thank you very much Atomix

joesaliba


atomix

New Release.

Optimization and improved performance.

Pepe

Atomix, why if I use its library for the ssd1306 does it stop printing on the screen when the portb is used within an interrupt?
If the switch is activated, the LEDs continue to work but the printout hangs, which does not happen if I use another library as shown in the other example.

atomix

#52
Pins are incorrectly announced in your code:

$define LCD_SCL    PORTB.1
$define LCD_SDA    PORTB.0

It is necessary to fix it:

$define LCD_SCL    PORTB.1
$define LCD_SDA    PORTB.2

And also replace in your code:

Symbol led2  LATB.6
Symbol led3  LATB.7

My library use LAT registers.

Pepe

Thank you very much Atomix for your help

Pepe

#54
Atomix is correct that when I using Declare Float Display Type = Fast
don't show decimal value when I use dec1
I show two images using Float_Display_Type = Fast in one yes and in the other no

atomix

#55
New Stable Release.

Fixed:
- The correct work of the port for other task where SDA, SCL pins are.
- Print numbers.
- Other minor corrections.

Pepe

Atomix I am using a pic 18f2550 in an application where the usb is not used
and to take better advantage of the ram without using the usb add this in the universal library

$ifdef freeram
           Dim Lcd_Buf[LCD_SIZE] As Byte At __USBOut_Buffer
      $else
           Dim Lcd_Buf[LCD_SIZE] As Byte Heap
$endif
I don't know if you want to consider it

atomix

May be i do this:

$define Lcd_Buf_Mem()   At __USBOut_Buffer

Dim Lcd_Buf[LCD_SIZE] As Byte Lcd_Buf_Mem

top204

#58
Excellent coding Atomix, and many thanks.

If using a USB device, but no USB peripheral is being used, the compiler can be told that the device does not contain a USB peripheral and it will free up all the dual port RAM available on it, because it no longer needs the USB buffer to be implemented. Use the declare:

Declare Onboard_USB = 0

top204

Pepe, your horizon looks excellent. What program are you creating?