본문 바로가기
반응형

kernel13

[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-10] H-Smart4412 응용 실습1 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1.Tack Switch로 LED 작동시키기 #include #include #include #include #include #include #include #include #define tact_d "/dev/tactsw" #define led_d "/dev/led" void led_right(int led); void led_left(int led); void led_on(int led); void led_twist(int led); void led_inside(int led); void led_off(int.. 2016. 12. 26.
[Kernel Porting-9] H-Smart4412 Dot Matrix 작동하기 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1. dot.c - dot matrix 점멸하기 #include #include #include #define dot "/dev/dot" int main() { int dot_d, i; unsigned char c[8] = {0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x00}; if((dot_d = open(dot, O_RDWR)) < 0) { printf("Can't Open\n"); exit(0); } write(dot_d,&c,sizeof(c)); sleep(1); close(dot_d.. 2016. 12. 26.
[Kernel Porting-8] H-Smart4412 LCD 작동하기 작업 환경 -메인 OS : Windows 8.1K(Intel Core i5-4590) -작업 OS : Ubuntu 14.04 64bit(VirtualBox) -장 비 명 : H-Smart4412 1. lcd.c - scanf로 입력 받아 lcd에 띄우기 #include #include #include #include #define clcd "/dev/clcd" int main() { int clcd_d; char buf[10]; if((clcd_d = open(clcd,O_RDWR)) < 0) { perror("open"); exit(1); } scanf("%s",buf); write(clcd_d,&buf,strlen(buf)); close(clcd_d); return 0; } 2016. 12. 26.
반응형