반응형 dip2 [Kernel Porting-11] H-Smart4412 응용 실습2 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1.Tack Switch와 Dot Matrix 를 이용한 계산기 #include #include #include //driver location #define dot "/dev/dot" #define tact "/dev/tactsw" int Opent(void); int Opend(unsigned char c); int flag = 0; unsigned char op, result; unsigned char c2[3]={0}; int main() { int dot_d, tact_d; unsigned char c;.. 2016. 12. 26. [Kernel Porting-7] H-Smart4412 Dip Switch 작동하기 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1. dipsw.c - Dip Switch 작동 값 출력 #include #include #include #include #define dip "/dev/dipsw" int main() { int dip_d; unsigned char c; if((dip_d = open(dip,O_RDWR)) < 0) { perror("open"); exit(1); } while(1) { while(1) { read(dip_d,&c,sizeof(c)); if(c) break; } printf("%d\n",c); return 0; .. 2016. 12. 26. 이전 1 다음 반응형