⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 9021b315f319001b180790659e27d27b

📁 一个完整的设计DE2_project,希望对大家有所帮助
💻
字号:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <io.h>
#include <fcntl.h>
#include <unistd.h>
#include <math.h>
#include "altera_avalon_pio_regs.h"
#include "system.h"  
#include "VGA.h"
void main(void)
{ 
  unsigned int i=0;
  unsigned int j=0;
  unsigned int k;
  unsigned int l;
  //int c=0;
  printf("\nstart!"); 
 /* IOWR(VGA_0_BASE,40000+256,RGB(1023,1023,1023)); 
for(k=0;k<20;k++)
{
   IOWR(VGA_0_BASE,40000+k,RGB(51*k,51*k,51*k));  
}
  for(i=0;i<257;i++)
  {
    k=IORD(VGA_0_BASE,40000+i);
    printf("\n%d      %d ",i,k);
  }
 for(k=1;k<20;k++)
  {
      for(i=0;i<200;i++)
      for(j=k*10;j<(k+1)*10;j++)
      Vga_Set_Pixel(VGA_0_BASE,i,j,k);
   }
  printf("\n%d",RGB(51*19,51*19,51*19));*/
  //////////////////////////////////
  unsigned int d,m,a;
    for(a=0;a<15;a++)
  {
    if(!((a/4)%2))
    {     
      for(j=0;j<M1;j++)
      {
        d=int(floor(180+70*sin((2*PI*j/M1)+a*PI/2)));  //I
        d=1024*d/256;
        SetColor(RGB(d,d,d));
        for(i=0; i<11; i++)   
        {
        MoveTo(1,j+M1*i+4);
        LineTo(200,j+M1*i+4);  
        }
    
      } 

    }   
    else
    {
      for(j=0;j<M2;j++)
      {
        d=int(floor(180+70*sin((2*PI*j/M2)+a*PI/2)));  //I
        d=1024*d/256;
        SetColor(RGB(d,d,d));
        for(i=0; i<11; i++)
        {
        MoveTo(1,j+M2*i+4);
        LineTo(200,j+M2*i+4);
        }
      }
    }
      } 
  //////////////////////////////////
  
  
  
  


}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -