CCS 3.168 + Grafik LCD + Proteus :)

Başlatan Analyzer, 14 Aralık 2003, 23:42:54

Analyzer

Selam,

Arkadaşlar ccs 3.168 ile grafik lcd kullanan arkadaş var mı? Bir

türlü kontrol edemedim.Proteusta simulasyonu ve c kodlarına ihtiyacım var.
Şimdiden teşekkür ederim.

Analyzer.
Üşeniyorum, öyleyse yarın!

EES

CCS 3.168  

\DRIVERS\GLCD.C


dosyası işini görmezse, projelerimizden bir örnek gönderebiliriz.

Analyzer

Dostum ben o dosya ile bayaa bir uğraştım.Eğer elinde dsn dosyası+ccs c kaynak kodu var ise ve paylaşabilirsen çok

sevinirim.Teşekkürler.

Analyzer
Üşeniyorum, öyleyse yarın!

asm_Coder

basic istersen t6969 için yardımcı olarabilirim.
y=f(x);

Analyzer

Alıntı yapılan: "BTIGER"basic istersen t6969 için yardımcı olarabilirim.
Teşekkür

ederim.Genelde diller kendilerine özel library'leri kullandıkları için çok zor oluyor çevirmek.Mesela HiTech C kaynak kodunu CCS C kaynak koduna çevirmek bile çok zahmetli.Elinde hazır olan

arkadaşlar yardımcı olabilirler umarım..

Analyzer.
Üşeniyorum, öyleyse yarın!

byka

I'm converting a graphic LCD routine to CCS C Compiler?

void
LCD_PutPixel(unsigned char x, unsigned char y, unsigned char Set)
{
unsigned int XY;
unsigned char bitByte;
  XY=0x200;
 
XY=XY+(y*40);
  XY=XY+(x/6);
  LCD_SendData(XY & 0x00FF);
  LCD_SendData(XY>>8);
 
LCD_SendCmd(0x24);         //pointer set
  bitByte=5-(x % 6);
 Set? bitByte|=0xF8: bitByte|=0xF0;            
 
LCD_SendCmd(bitByte);   //0b1111SXXX , s is set/reset, xxx is bit    
  ///number xxx
  //(Each memorybyte i six graphics bits (pixels))
}
CCS Did not recognized this line:
     Set? bitByte|=0xF8: bitByte|=0xF0;
is it the same thing with:
  if (Set==0) {
bitByte|=0xf8;}
  else
     {bitByte|=0xf0;}
or should it be:
  if (Set==1) { bitByte|=0xf8;}
  else
     
{bitByte|=0xf0;}


cevap....
The last of your examples is almost correct, but not completely the same as Set?.

Set?
bitByte|=0xF8: bitByte|=0xF0;


is it the same as:

if (Set)
  bitByte|=0xF8;       //If Set is true (not
zero), i.e. 1, 2, 3 etc.
else
  bitByte|=0xF0;       //If Set is false (zero).


You can also write if (Set != 0) it's the same thing as if (Set)



But you should not write if (Set == 1), that's not the same, because the if statement is true for every value different from 0, not only 1, but also 2, 3 etc.

Maybe Set can have

the value 2, then the if statment should still be true, like it is when you write Set?
DWIN LCD Satış Türkiye email:info@kamantek.com  web:http://www.kamantek.com/shop/index.php