色婷婷AⅤ一区二区三区|亚洲精品第一国产综合亚AV|久久精品官方网视频|日本28视频香蕉

          新聞中心

          AVR 1602液晶字符移動(dòng)

          作者: 時(shí)間:2016-11-30 來(lái)源:網(wǎng)絡(luò) 收藏

          void delay(int k)
          {
          int i,j;
          for(i=0;i {
          for(j=0;j<1140;j++);
          }
          }
          void wait()
          {
          uchar val;
          DATA=0xff;
          RS=0;
          RW=1;
          __no_operation();
          __no_operation();
          EN=1;
          __no_operation();
          __no_operation();
          DDRA=0x00;
          val=PINA;
          while(val&busy)
          {
          val=PINA;
          }
          EN=0;
          DDRA=0xff;
          }

          void writecmd(uchar cmd)
          {
          wait();
          RS=0;
          RW=0;
          __no_operation();
          DATA=cmd;
          __no_operation();
          EN=1;
          __no_operation();
          __no_operation();
          EN=0;
          }
          void writedata(uchar data)
          {
          wait();
          RS=1;
          RW=0;
          __no_operation();
          DATA=data;
          __no_operation();
          EN=1;
          __no_operation();
          __no_operation();
          EN=0;
          }

          void displayonechar(uchar x,uchar y,uchar dda)
          {
          y&=0x01;
          x&=0x0f;
          if(y)x|=0x40;
          x|=0x80;
          writecmd(x);
          writedata(dda);
          }
          void displaychar(uchar x,uchar y,uchar *p)
          {
          y&=0x01;
          x&=0x0f;
          while(*p!=