LCDInfo.com

http://www.lcdinfo.com
It is currently Mon Nov 25, 2024 0:20

All times are UTC + 2 hours




Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11  Next
Author Message
 Post subject:
PostPosted: Thu Jun 05, 2003 11:04 
Offline

Joined: Fri Feb 21, 2003 5:41
Posts: 43
@all

Hi People

I have writen a new LCDProg called LCD MediaCase
Is a full repleacemend of Winamp :wink:

No Form.. This file will only work with your Keyboard.
I have a limited Version upload of my Site you can download it from here
http://dschi-el-zeh.de/Dateien/LCD%20MediaCase.rar

otherwise you can have a fullversion then mail me or write a message to this board with your mail and i will send it to you. It's Freeware

This File work on a T6963C 240x128 with connected to LPT1 you can change it write the new adr.. to the LCD MediaCase.ini

Please show here any sreenshots:

Image


Image


Image


Image

Greetings Emil


Last edited by Emil Weiss on Sat Aug 02, 2003 17:10, edited 4 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 24, 2003 19:04 
Offline

Joined: Thu Jul 24, 2003 19:00
Posts: 16
Hello,

I'm using visual basic .net 2003
and it says that RShiftLong isn't declared ?

i searched (here, altavista, msdn) and didn't find any declaration

can someone help me pls


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 24, 2003 21:59 
Offline

Joined: Fri Feb 21, 2003 5:41
Posts: 43
Use this

Code:

Public Function RShiftLong(ByVal Value As Long, _
                           ByVal Shift As Integer) As Long

Dim hi As Long

    MakeOnBits
    If (Value And &H80000000) Then hi = &H40000000

    RShiftLong = (Value And &H7FFFFFFE) \ (2 ^ Shift)
    RShiftLong = (RShiftLong Or (hi \ (2 ^ (Shift - 1))))

End Function



Code:
Private Sub MakeOnBits()

Dim j As Integer, _
        v As Long

    For j = 0 To 30

        v = v + (2 ^ j)
        OnBits(j) = v

    Next j

    OnBits(j) = v + &H80000000

End Sub


Code:
Public Function LShiftLong(ByVal Value As Long, _
                           ByVal Shift As Integer) As Long

    MakeOnBits

    If (Value And (2 ^ (31 - Shift))) Then Exit Function

    LShiftLong = ((Value And OnBits(31 - Shift)) * (2 ^ Shift))

End Function


Greetings Emil


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 25, 2003 23:40 
Offline

Joined: Thu Jul 24, 2003 19:00
Posts: 16
I don't understand how you show a BMP on your LCD
I have made this code but some pixels aren't filled up

if i use a black BMP then some pixels aren't filled and there are vertical lines that aren't filled.

Code:
       
Dim picX As Integer
Dim picY As Integer

        For picX = 0 To Picture1.Width - 1
            For picY = 0 To Picture1.Height - 1
                Dim bmp As Bitmap = Picture1.Image
                Dim clr As Color = bmp.GetPixel(picX, picY)
                If clr.Name = "ff000000" Then
                    SetLCDPixel(picX, picY)
                End If
            Next
        Next


pls help :cry:


Top
 Profile  
 
PostPosted: Sat Aug 02, 2003 16:35 
Marc wrote:
The waitDisplay function don't make a delay ¿? I think tht this don't seem to be a delay problem, because all are drawn except a few bits. -_-'

I'm being crazy, whats possible that there are pixels that don't draw !!! :? :? :? :? :? . And when i'm trying to display a whole image in Hexadecimal values, it seems that divide the lcd display in two.

Example:

This is the LCD
|------------------------|
|·····cccccc···········ccc|
|·····cccccc···········ccc|
|·····cccccc···········ccc|
|------------------------|

This is the BMP
ccccccc
ccccccc
ccccccc

It's like divide the display, i don't understand anything :evil: :evil:
I hope you understand the draw.

Thanks
[code][/code]


Top
  
 
 Post subject:
PostPosted: Sat Aug 02, 2003 22:04 
HI Marc

Please send me the source
I will show for the Problem!

I only have VB_NET 2002 v.1.1

Greetings Emil


Top
  
 
PostPosted: Mon Aug 04, 2003 12:02 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
sachin wrote:

I'm being crazy, whats possible that there are pixels that don't draw !!! :? :? :? :? :? . And when i'm trying to display a whole image in Hexadecimal values, it seems that divide the lcd display in two.

Example:

This is the LCD
|------------------------|
|·····cccccc···········ccc|
|·····cccccc···········ccc|
|·····cccccc···········ccc|
|------------------------|

This is the BMP
ccccccc
ccccccc
ccccccc

It's like divide the display, i don't understand anything :evil: :evil:
I hope you understand the draw.

Thanks[/size]


Hmm, I'm not sure who wrote all this and if this is quote from earlier discussion or new problem.

Anyway if you get that kind output it might be a problem with font size setting. Have you tried using any programs that drive T6963C and is the output fine with them ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 05, 2003 2:22 
Offline

Joined: Thu Jul 24, 2003 19:00
Posts: 16
Henri can you help me, i can't seem to display bitmaps on my lcd

everything works

i scan every pixel of a PictureBox to see what color it has and then use
setLCDpixel(x,y) if the color is black

but then some pixels aren't drawn and i have lines that aren't filled

can you paste some code (visual basic .net) for displaying bitmaps please

i use tweakers.net wiring if you need to know


thnx in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 06, 2003 13:19 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
soul wrote:
Henri can you help me, i can't seem to display bitmaps on my lcd

everything works

i scan every pixel of a PictureBox to see what color it has and then use
setLCDpixel(x,y) if the color is black

but then some pixels aren't drawn and i have lines that aren't filled

can you paste some code (visual basic .net) for displaying bitmaps please

i use tweakers.net wiring if you need to know

thnx in advance

Unfortunately I can't give any visual basic code as I've never worked with that. Others have been posting some VB code in this forum.

Are you using any busy flag checking in your code ? Writing too fast to the controller might be one reason for problems like that.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2003 0:41 
Offline

Joined: Thu Jul 24, 2003 19:00
Posts: 16
I got the waitdisplayready function to work and now i got a bitmap
on my screen but pixel (5,0) & (6x0) aren't showed and i also have vertical lines every 12 pixels i think who aren't filled

i saw this other thread where somebody had the same problem and you posted some code there:

Code:
void cT6963C::DrawAnimFrame(Graphics::TBitmap *frameBitmap, int x, int y)
{

  int addr;

  for(int i=0;i<frameBitmap->Height;i++)
  {
    // set address pointer to beginning of row
    addr = G_BASE + ((y+i)*BYTES_PER_ROW) + (x/font_width);
    T6963C.WriteData(addr & 0xFF);
    T6963C.WriteData(addr >> 8);
    T6963C.WriteCtrl(0x24);

    T6963C.WriteCtrl(0xB0); // auto write mode on

    for(int j=0;j<frameBitmap->Width;j++)
    {
      BYTE lcdValue = 0;

      // build the byte to send to display
      for(int k=0;k<font_width-1;k++) // add all bits except last one
      {
        lcdValue |= (frameBitmap->Canvas->Pixels[font_width*j+k][i]!=0 ? (byte)0 : (byte)1);
        lcdValue <<= 1;
      }
      lcdValue |= (frameBitmap->Canvas->Pixels[font_width*j+5][i]!=0 ? (byte)0 : (byte)1); // add
last bit to byte
     
      T6963C.WriteData(lcdValue);
    }

    T6963C.WriteCtrl(0xB2); // auto write mode off
  }

}


i do not understand the
void cT6963C::DrawAnimFrame(Graphics::TBitmap *frameBitmap, int x, int y)

how much is x and y ?? are these the highest x and y values of the bitmap ??

edit: i tried the code but my LCD seems to go crazy with the auto write modes, i need to reset the LCD for it to work properly again

i don't understand it :(

isn't there any other way to display a bitmap
or can you explain it how it works ?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2003 14:01 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
soul wrote:
I got the waitdisplayready function to work and now i got a bitmap
on my screen but pixel (5,0) & (6x0) aren't showed and i also have vertical lines every 12 pixels i think who aren't filled

Hmm, have you initialized the display to the settings you want to use ? Like font size 6x8 or 8x8 ?

Which size display do you have and what are your T6963C initialization settings ?

Quote:
i do not understand the
void cT6963C::DrawAnimFrame(Graphics::TBitmap *frameBitmap, int x, int y)

how much is x and y ?? are these the highest x and y values of the bitmap ??

X and Y are the starting position of the up left corner of the bitmap. So you can put the bitmap where you want on the screen.

Quote:
isn't there any other way to display a bitmap
or can you explain it how it works ?

Well the ways I can think to put a bitmap to T6963C display:
-write pixel by pixel using the pixel set command (slowest, writes 4 bytes to the display for every bitmap pixel )
-write byte at time using the normal byte write command (faster, writes 2 bytes(command byte+data byte) to display for every data byte sent)
-write byte at time using the auto write command (fastest, writes one byte(the data byte) to the display for every data byte sent)

Depending of either 6x8 or 8x8 font mode one byte transfers 6 or 8 pixels in the byte write modes.

So if you can correctly get the pixel information of your bitmap I don't see why you couldn't get it work by sending pixel at time although it's slow.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2003 15:27 
Offline

Joined: Thu Jul 24, 2003 19:00
Posts: 16
i have a 240x128 DataVision, font 6x8 and used the tweakers.net wiring

i use this code to initialize the lcd
Code:
BYTES_PER_ROW = 40
T_BASE = &H0
G_BASE = &H300

        WriteData(T_BASE And &HFF)
        WriteData(T_BASE >> 8)
        WriteCtrl(&H40)

        WriteData(BYTES_PER_ROW)
        WriteData(0)
        WriteCtrl(&H41)

        WriteData(G_BASE And &HFF)
        WriteData(G_BASE >> 8)
        WriteCtrl(&H42)

        WriteData(BYTES_PER_ROW)   
        WriteData(0)
        WriteCtrl(&H43)

        WriteCtrl(&H80)
        WriteCtrl(&HA7)
        WriteData(&H0)
        WriteData(&H0)
        WriteCtrl(&H21)

        WriteCtrl(&H9D)


Quote:
So if you can correctly get the pixel information of your bitmap I don't see why you couldn't get it work by sending pixel at time although it's slow.


Because i think the code to put an pixel on the LCD isn't correct:

Code:
    Public Sub SetLCDPixel(ByVal Xwaarde As Short, ByVal Ywaarde As Short)
        Dim addr As Integer
        addr = (G_BASE + (Ywaarde * 40)) + (Xwaarde / 6)
        WriteData(addr And &HFF)
        WriteData(addr >> 8)
        WriteCtrl(&H24)
        WriteCtrl(&HF8 Or (5 - (Xwaarde) Mod 6))
    End Sub


I have the same problem as floppes in the other thread:
http://www.skippari.net/phpBB2/viewtopi ... 8&start=15 (3th post)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 08, 2003 22:19 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
soul wrote:
Because i think the code to put an pixel on the LCD isn't correct:

Code:
    Public Sub SetLCDPixel(ByVal Xwaarde As Short, ByVal Ywaarde As Short)
        Dim addr As Integer
        addr = (G_BASE + (Ywaarde * 40)) + (Xwaarde / 6)
        WriteData(addr And &HFF)
        WriteData(addr >> 8)
        WriteCtrl(&H24)
        WriteCtrl(&HF8 Or (5 - (Xwaarde) Mod 6))
    End Sub


Ok, I don't see anything wrong in that but I'm not VB expert so I might not even notice if something's wrong.

Anyway here are the functions that I believe are working fine for me:
Code:
void SetLCDPixel(int x, int y)
{
  int addr;

  addr = G_BASE + (y*BYTES_PER_ROW) + (x/font_width);
  WriteData(addr & 0xFF);
  WriteData(addr >> 8);
  WriteCtrl(0x24);
  WriteCtrl(0xf8 | (font_width-1-(x % font_width)));
}

void ClearLCDPixel(int x, int y)
{
  int addr;

  addr = G_BASE + (y*BYTES_PER_ROW) + (x/font_width);
  WriteData(addr & 0xFF);
  WriteData(addr >> 8);
  WriteCtrl(0x24);
  WriteCtrl(0xf0 | (font_width-1-(x % font_width)));
}



Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 09, 2003 4:54 
Offline

Joined: Thu Jul 24, 2003 19:00
Posts: 16
I don't see a problem either

But in the source of LCD info this code is used:

Code:
void cT6963C::ShowBMP(Graphics::TBitmap *pBitmap)
{
  int x=0,y=0,z;
  int i;
  int addr;
  float pp; 
 TColor p;

  Randomize();
     //bitmap to the program window
    //Canvas->Draw(15,350,pBitmap);
  addr = G_BASE + (y*BYTES_PER_ROW) + (x/font_width);

  T6963C.WriteData(addr & 0xFF);
  T6963C.WriteData(addr >> 8);
  T6963C.WriteCtrl(0x24);

  for (y=0;y<ypixels;y++)
    for (x=0;x<xpixels/font_width;x++)
    {
      i=0;
      for(z=0;z<font_width;z++)
      {
        p=pBitmap->Canvas->Pixels[x*font_width+z][y];
        pp=0.6*(p & 0xFF)+0.30*((p >> 8) & 0xFF)+0.1*((p >> 16) & 0xFF);
        i=i << 1;
        if (pp<=random(255))
           i=i | 1;
      }
      T6963C.WriteData(i);
      T6963C.WriteCtrl(0xC0);
    }
}


I understand most if it, but what value do you get from p
i know its a color but in what format: is it hex, rgb,... ?

Why is this in it:
Code:
pp=0.6*(p & 0xFF)+0.30*((p >> 8) & 0xFF)+0.1*((p >> 16) & 0xFF);

and why using random(255) ?


i used
Code:
0.6*(p & 0xFF)+0.30*((p >> 8) & 0xFF)+0.1*((p >> 16) & 0xFF

in visual basic and when i entered 0 as a value for p then i got 255 for pp
i see that the value has to be smaller or equal to 255 for i to be i or 1

but the 255 is random so it even could be 200 or 75 or everything
(i don't know how c/c++ works if you use random)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 12, 2003 10:13 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
soul wrote:
I understand most if it, but what value do you get from p
i know its a color but in what format: is it hex, rgb,... ?

Why is this in it:
Code:
pp=0.6*(p & 0xFF)+0.30*((p >> 8) & 0xFF)+0.1*((p >> 16) & 0xFF);

and why using random(255) ?


Well, I don't know why this has been done like this in the code. I took that from some Delphi T6963C example and just used in the first LCDInfo versions.

I haven't been using VCL bitmaps for some time but I think I've been using a version of this that has just read if the pixel is black or white (0 or something else) and not using any random functions.

Here's a description for TColor (p variable in the code) from C++Builder's help:

Quote:
enum TColor {clMin=-0x7fffffff-1, clMax=0x7fffffff};

Description

TColor is used to specify the color of an object. It is used by the Color property of many components and by a number of other properties that specify color values.

The Graphics unit contains definitions of useful constants for TColor. These constants map either directly to the closest matching color in the system palette (for example, clBlue maps to blue) or to the corresponding system screen element color defined in the Color section of the Windows Control panel (for example, clBtnFace maps to the system color for button faces).

If you specify TColor as a specific 4-byte hexadecimal number instead of using the constants defined in the Graphics unit, the low three bytes represent RGB color intensities for blue, green, and red, respectively. The value $00FF0000 represents full-intensity, pure blue, $0000FF00 is pure green, and $000000FF is pure red. $00000000 is black and $00FFFFFF is white.

If the highest-order byte is zero ($00), the color obtained is the closest matching color in the system palette. If the highest-order byte is one ($01), the color obtained is the closest matching color in the currently realized palette. If the highest-order byte is two ($02), the value is matched with the nearest color in the logical palette of the current device context.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 163 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11  Next

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 27 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group