

Moderators: Chuckt, Garth, bitfogav
Code: Select all
program Glcd_Test
' Glcd module connections
dim GLCD_DataPort as byte at PORTD
dim GLCD_CS1 as sbit at LATB1_bit ' for writing to output pin always use latch (PIC18 family)
GLCD_CS2 as sbit at LATB0_bit ' for writing to output pin always use latch (PIC18 family)
GLCD_RS as sbit at LATB2_bit ' for writing to output pin always use latch (PIC18 family)
GLCD_RW as sbit at LATB3_bit ' for writing to output pin always use latch (PIC18 family)
GLCD_EN as sbit at LATB4_bit ' for writing to output pin always use latch (PIC18 family)
GLCD_RST as sbit at LATB5_bit ' for writing to output pin always use latch (PIC18 family)
dim GLCD_CS1_Direction as sbit at TRISB1_bit
GLCD_CS2_Direction as sbit at TRISB0_bit
GLCD_RS_Direction as sbit at TRISB2_bit
GLCD_RW_Direction as sbit at TRISB3_bit
GLCD_EN_Direction as sbit at TRISB4_bit
GLCD_RST_Direction as sbit at TRISB5_bit
' End Glcd module connections
sub procedure Delay2S() ' 2 seconds delay sub function
Delay_ms(2000)
end sub
main:
CMCON = CMCON or 0x07 ' turn off comparators
ADCON1 = ADCON1 or 0x0F ' turn off analog inputs
Glcd_Init() ' Initialize Glcd
Glcd_Fill(0x00) ' Clear Glcd
while TRUE
Glcd_Image(@cat_bmp) ' Draw image
Delay2s() Delay2s()
Glcd_fill(0x00) ' Clear GLCD
Glcd_Image(@brads_bmp) ' Draw image
Delay2s() Delay2s()
Glcd_fill(0x00) ' Clear GLCD
wend
end.
Code: Select all
module Bitmap
' ------------------------------------------------------
' GLCD Picture name: Bifogav.bmp
' GLCD Model: KS0108 128x64
' ------------------------------------------------------
const brads_bmp as byte[1024] = (
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 241, 240, 240, 112, 16, 0, 0, 0, 192, 240, 240, 240, 240, 224, 1, 1, 3, 7, 255, 255, 255, 255, 31, 15, 15, 15, 31, 255, 255, 255, 255, 255, 63, 31, 31, 31, 255, 255, 255, 255, 255, 255, 255, 255, 63, 7, 3, 1, 129, 224, 240, 240, 240, 240, 240, 248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 63, 15, 1, 0, 0, 192, 192, 194, 195, 195, 131, 131, 1, 16, 56, 120, 252, 255, 255, 255, 31, 7, 3, 2, 226, 254, 255, 231, 227, 3, 3, 0, 0, 192, 224, 226, 227, 243, 199, 195, 195, 3, 3, 0, 0, 192, 192, 194, 195, 195, 67, 7, 15, 7, 7, 131, 195, 195, 131, 3, 7, 15, 31, 255, 255, 63, 15, 7, 7, 131, 195, 195, 195, 3, 7, 3, 3, 227, 255, 127, 31, 15, 7, 7, 131, 195, 195, 195, 7, 7, 3, 3, 227, 255, 255, 31, 3, 3, 3, 255, 127, 63, 15, 7, 3, 195, 227, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 63, 7, 1, 0, 0, 224, 248, 255, 255, 255, 127, 127, 63, 31, 15, 0, 0, 128, 224, 255, 255, 199, 128, 128, 128, 128, 135, 135, 199, 255, 199, 128, 128, 128, 128, 135, 135, 135, 207, 255, 127, 15, 3, 0, 128, 224, 248, 255, 255, 255, 255, 255, 255, 240, 192, 128, 128, 135, 135, 135, 135, 131, 192, 224, 240, 124, 127, 96, 64, 0, 0, 7, 71, 7, 3, 0, 0, 96, 124, 127, 127, 255, 224, 192, 128, 128, 135, 135, 135, 195, 192, 128, 128, 132, 135, 135, 199, 255, 192, 128, 128, 128, 192, 224, 240, 252, 254, 255, 255, 255, 255, 255,
255, 15, 7, 3, 1, 1, 224, 240, 240, 240, 240, 240, 112, 16, 0, 0, 0, 128, 224, 240, 240, 240, 240, 240, 240, 240, 240, 248, 248, 252, 252, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 31, 7, 1, 0, 128, 240, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 7, 1, 0, 0, 48, 120, 120, 56, 24, 8, 0, 0, 128, 224, 248, 248, 248, 248, 248, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 254, 248, 240, 240, 224, 224, 225, 225, 225, 224, 240, 240, 248, 248, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 248, 248, 248, 252, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 248, 248, 248, 248, 248, 248, 252, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
)
implements
end.
The refresh rate is slightly poor if you are using it to drawing graphics such has the ball moving around the screen fast, the screen is flickery, especially if you constantly clear the screen after every frame.brad wrote:How do you find the refresh rate? is it a little flickery, or does it have ghosting?
bitfogav wrote:Thanks for posting that Jay, ill have a look at it and see if I can transfer it into Swordfish codevery cool thou!!
heres what ive been doing
finally man!!, bitfogav this is what i have been looking for /trying to do using the mikro C glcd libraries , but i didnt know how. i hope you could help me with porting your code to mikro C using a pic18f4550 and a wg12864b ks0108 based lcd display. and also adding an additional paddle and scoring! hence(pong).
Users browsing this forum: No registered users and 6 guests