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

📄 8255a_3.cpp

📁 在纯DOS下运行的TurboC3_ucos2_ucgui bug改进版本
💻 CPP
字号:
/* 8255a_3.cpp
  HD 97413083 YGM
  set number to 8255a and then read it into computer
   and display every bit on screen
*/
#include "interfac.h"
#include "iostream.h"
#include "string.h"
P8255A  p8255a3;

void main()
 {

   cout<<"press any key to start ! "<<endl;
   getch();
   p8255a3.SetCtrl(0x80);          // 1000 000
   int portb=p8255a3.ReadPort(P8255A_B);
   for(int i=4;i<8;i++)
    { int abit=p8255a3.GetBit(portb,i);
      cout<<"PB"<<i<<"="<<abit<<"   ";
    }
    cout<<endl;
   int port_c=p8255a3.ReadPort(P8255A_C);
   for(i=0;i<8;i++)
    { int abit=p8255a3.GetBit(port_c,i);
      cout<<"PC"<<i<<"="<<abit<<"  ";
    }

 }

⌨️ 快捷键说明

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