📄 test.c~
字号:
//============================================================================// Name : test_camera.cpp// Author :// Version :// Copyright : Your copyright notice// Description : Hello World in C, Ansi-style//============================================================================#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include <sys/types.h>#include <sys/mman.h>#include <fcntl.h>#include <sys/ioctl.h>#include <sys/stat.h>#include <time.h>#include <linux/delay.h>#include <poll.h>#include <signal.h>#define DIMENS 100int main(void) { static int fd; int i; struct pollfd poll_data; int valoare; unsigned char bval; unsigned char buffer[DIMENS]; int citit; fd = open("/dev/PORTJ", O_RDWR); if (fd < 0) { printf("Eroare open portj\n"); return -1; } while(1){ //citit=read(fd , &valoare , DIMENS); valoare=0; //citit=read(fd , &valoare , 4); citit=read(fd , &bval , 1); printf("Valoare = %x\n", bval); getchar();} close(fd); puts("Hello World!!!"); return EXIT_SUCCESS;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -