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

📄 stop_motor.cgi.c

📁 uclinux下用cgi 实现直流电机控制
💻 C
字号:
 #include <stdio.h>#include <stdlib.h>#include<unistd.h>#include<fcntl.h>#include<linux/rtc.h>#include<linux/ioctl.h>#include <linux/errno.h>#include <linux/fs.h>int main(void){int fd;int value[2]={0,0};printf("Content-Type:text/html\n\n");//头标信号printf("<TITLE>停止电机</TITLE>\n");printf("<HR>");fd=open("/dev/motor_drv",O_RDWR);if(fd==-1){perror("open");printf("you are wrong"); exit(-1);	}else write(fd,value,2*sizeof(int));printf("<P>您已经成功使电机开始正向运转!</P>");//else printf("<P>停止电机运转失败!</P>");printf("</br>");printf("</br>");printf("<a href=../motor_form.html>返回首页</a>");close(fd);return 0;}

⌨️ 快捷键说明

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