#include "iostream.h" #include "stdlib.h" #include "unistd.h" // sleep() #include "irs.h" #include "disp.h" void showLogo(void); int main(void) { Irs irs; int i,num; int count=0; cout << CLR; locate(1,1); showLogo(); for(;;){ locate(1,6); cout << " \n"; locate(1,6); // irs.showData(); // for(i=0;i<2;i++){ // cout << "IRS_" << i << ": " << irs.getValue(i) << '\n'; // } cout << "IRS_0: " << irs.getValue(0) << '\n'; irs.showData(); sleep(1); cout << "IRS_1: " << irs.getValue(1) << '\n'; cout << '\n'; cout << "-------------------\n"; irs.showData(); cout << "FEDC BA98 7654 3210\n"; cout << "\n\ncount: " << count++ << endl; cout << flush; usleep(100000); sleep(1); } return EXIT_SUCCESS; } void showLogo(void) { cout << BOLD << GREEN << "MIRS" << CYAN << "0204\n\n"; cout << BLUE << "Test Program "; cout << WHITE << TURN << " Infrared Sensor \n\n"; cout << DEFAULT; }