اطلاعیه

Collapse
No announcement yet.

مشکل با ارسال عکس flash بر رویglcd در کدویژن 2.05.3

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    مشکل با ارسال عکس flash بر رویglcd در کدویژن 2.05.3

    سلام به همگی

    نمیدونم با این ورژن جدید کدویژنکار کردید یا نه....؟ ورژن 2.05.3 v رو عرض میکنم... این ورژن توابعی برای راه اندازی GLCD با چیستهای مختلف هم داره...

    من یه برنامه نوشتم و در آن میخواهم عکسی که ازطریق نرم افزار Glcd_tools به فرمت bitmap تبدیل کردم رو در glcd نمایش بدم ولی اینکار انجام نمیشه...!!

    برنامه اینه :
    کد:
    #include <delay.h> 
    #include <mega32.h>
    // Graphic LCD functions
    #include <glcd.h>
    // Font used for displaying text
    // on the graphic LCD
    #include <font5x7.h>
      GLCDINIT_t glcd_init_data;
     int i,j,p,a2d;
     int k=0;
    int data[128];
    flash unsigned char picture1[]={
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x50,0x40,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
     0x00,0x10,0x20,0x20,0x20,0x2C,0x1C,0x04,0x04,0x05,0x05,0x00,0x00,0x04,0x04,0x04,0x04,0x05,0x05,0x06,0x04,0x04,0x04,0x02,0x04,0x04,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x06,0x05,0x05,0x04,0x05,0x07,0x04,0x14,0x05,0x00,0x03,0x00,0x00,0x00,0x20,0x20,0x10,0x09,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x02,0x04,0x04,0x04,0x06,0x05,0x05,0x05,0x07,0x00,0x00,0x20,0x20,0x10,0x09,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04,0x04,0x14,0x14,0x04,0x04,0x02,0x03,0x05,0x06,0x04,0x04,0x05,0x05,0x06,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
     0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
     0x00,0x02,0x04,0x04,0x04,0x05,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x01,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x10,0x20,0x20,0x20,0xA0,0x20,0x20,0x20,0x28,0x00,0x00,0x00,0x10,0xA8,0x20,0x20,0x21,0x28,0x20,0x28,0xA8,0x28,0x30,0x20,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x02,0x00,0x80,0x48,0x00,0x1F,0x00,0x00,0x00,0x00,0x00,0x88,0x20,0x20,0xA0,0x28,0x20,0x20,0x21,0x20,0x2C,0x00,0x00,0x00,0x00,0x20,0x20,0x22,0x20,0x20,0x28,0x28,0x28,0x30,0x20,0x20,0x00,0x1C,0x00,0x00,0x00,0x00,0xA8,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    };
    
    
    // ADC interrupt service routine
    interrupt [ADC_INT] void adc_isr(void)
    {
    if (k<128)
      {
       k++;
       data[k]=ADCW;
       glcd_setpixel (k,data[k]); 
       ADCSRA|=1<<ADSC;
       }
    }
    void selectch(void);
    void incvoltdiv (void);
    void decvoltdiv(void);
    void inctimediv(void);
    void dectimediv (void);
    void Lissajous (void);
    void main(void)
    {
    PORTB=0x00;
    DDRB=0x00;
    // Graphic LCD initialization
    // The KS0108 connections are specified in the
    // Project|Configure|C Compiler|Libraries|Graphic LCD menu:
    // DB0 - PORTC Bit 0
    // DB1 - PORTC Bit 1
    // DB2 - PORTC Bit 2
    // DB3 - PORTC Bit 3
    // DB4 - PORTC Bit 4
    // DB5 - PORTC Bit 5
    // DB6 - PORTC Bit 6
    // DB7 - PORTC Bit 7
    // E - PORTD Bit 0
    // RD /WR - PORTB Bit 1
    // RS - PORTB Bit 2
    // /RST - PORTB Bit 3
    // CS1 - PORTD Bit 4
    // CS2 - PORTD Bit 5
    // Specify the current font for displaying text
    glcd_init_data.font=font5x7;
    // No function is used for reading
    // image data from external memory
    glcd_init_data.readxmem=NULL;
    // No function is used for writing
    // image data to external memory
    glcd_init_data.writexmem=NULL;
    
    glcd_init(&glcd_init_data);
    
    glcd_putimagef(0,0, picture1,GLCD_PUTCOPY);
    delay_ms(2000);
    
    while (1)
       { 
        
        glcd_clear();
       for (i=0;i<128;i+=2){
       glcd_setpixel (64,i);
       }
       for (j=0;j<128;j+=2){
       glcd_setpixel (j,32);
       } 
       glcd_putcharxy( 1, 56, 'v'); 
       glcd_putcharxy( 66, 56, 't');
       glcd_putcharxy( 6, 56, '='); 
       glcd_putcharxy( 71, 56, '=');
       selectch();
       ADCSRA = 0b11100111;
       ADMUX = 0b01100000;
       SFIOR = 0x00;
       a2d = ADCW; 
       p = (1024 - (a2d))/16;
       for( i=0;i<1024;i++){
       for(j=0;j<=a2d ; j++)
       glcd_setpixel (p,i);
       }
    /////////////////// namayesh noghat bedast amadeh az tabdil bar roye 128 pixel ofoghi.
    for (i=0;i<127;i++){
    do{
    i=0;
    glcd_setpixel(i,p);
    delay_us(100);
    i++;
    if(i==128)
    i=0;
    }
    while(1);
    }
    }
    }
    ///////////// defination of selechch.
    void selectch (void)
    {
    do{
    //// first key for first channel
    if(PINB.0) 
      { 
      delay_ms(20);  
      if(PINB.0) 
      { 
      glcd_outtextxyf (2,5,"SEL CH1");
      delay_ms(400);
      for(i=0;i<15;i++){
      for(j=0;j<45;j++){
      glcd_clrpixel (i,j);
      }
      }
       ADMUX = 0b01100000;
        while(PINB.0);  
      } 
      }
    else
    /// secind key for second channel
      if(PINB) 
      { 
      delay_ms(20);  
      if(PINB) 
      { 
      glcd_outtextxyf (2,5,"SEL CH2");
      delay_ms(400);
      for(i=0;i<30;i++){
      glcd_clrpixel (2,i);
       ADMUX = 0b01100001;
       }
        while(PINB);  
      } 
      }
     else 
     ///// third key for both channel ((hamzaman ))
      if(PINB) 
      { 
      delay_ms(20);  
      if(PINB) 
      {
      glcd_outtextxyf (2,5,"SEL CH1&2");
      delay_ms(400);
      for(i=0;i<35;i++){
      glcd_clrpixel (2,i);
      }
      do{
       ADMUX = 0b01100001; 
       delay_ms(10);
       ADMUX = 0b01100000;
       delay_ms(10);
       }
       while(1);
       while(PINB);  
      } 
      } 
      }
      while(1);  
    }
    void incvoitdiv (void)
    {
    if(!PINB.3) 
      { 
      delay_ms(20);  
      if(!PINB.3) 
      { 
      // function declaration 
      while(!PINB.3);  
      } 
      } 
      while (1);
    }
    void decvoltdiv (void)
    {
    if(!PINB.4) 
      { 
      delay_ms(20);  
      if(!PINB.4) 
      { 
      // function declaration 
      while(!PINB.4);  
      } 
      } 
      while (1);
    }
    void inctimediv (void)
    {
    if(!PINB.5) 
      { 
      delay_ms(20);  
      if(!PINB.3) 
      { 
      // function declaration 
      while(!PINB.3);  
      } 
      } 
      while (1);
    }
    void dectimediv (void)
    {
    if(!PINB.6) 
      { 
      delay_ms(20);  
      if(!PINB.6) 
      { 
      // function declaration 
      while(!PINB.6);  
      } 
      } 
      while (1);
    }
    void Lissajous (void)
    {
    if(!PINB.7) 
      { 
      delay_ms(20);  
      if(!PINB.7) 
      { 
      // function declaration 
      while(!PINB.7);  
      } 
      } 
      while (1);
    }
    مشکلم هم با این دستور هست:

    glcd_putimagef(0,0, picture1,GLCD_PUTCOPY);
    delay_ms(2000);

    مطابق گفته های HELP کدویژن این دستور برای ارسال عکس با فرمت BMP و نوع داده flash بر روی glcd بکار میره...ولی الان خودم رو هلاک کردم اما نتونستم عکس رو در glcd نمایش بدم...میخواستم از شما دوستانی که حرفه ای تر هستید و از این نوع ارسالات عکس !!! انجام دادید درخواست راهنمایی بکنم...

    سپاس از محبتتون.

    #2
    پاسخ : مشکل با ارسال عکس flash بر رویglcd در کدویژن 2.05.3

    سایز عکس را اضافه عکس کنید یه چیزای نسان میده

    دیدگاه

    لطفا صبر کنید...
    X