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

📄 hello.cpp

📁 这个源代码s3c2410+linux的QT图形界面的简单制作。 实现了按键对LED灯的控制
💻 CPP
字号:
#include "hello.h"#include <qlabel.h>#include <stdio.h>#include <fcntl.h>#include <stdlib.h>#include <unistd.h>#include <sys/ioctl.h>void dly(int t){ long i; for(;t>0;t--) for(i=0;i<50000;i++);}HelloForm::HelloForm( QWidget* parent, const char* name, WFlags fl):HelloBaseForm(parent, name, fl){}HelloForm::~HelloForm(){}void HelloForm::SayHello(){	MessageLabel->setText("Hello dds,you do a good job!");}void HelloForm::Saygoodbye(){	MessageLabel->setText("Goodbye dds!!");}void HelloForm::dds(){  	int fd,i,x;        fd = open("/dev/leds", 0);	if (fd < 0)	{	 perror("Failed to open leds");	 exit(1);	}                for(x=0;x<5;x++)        {        for(i=0;i<=3;i++)         {          ioctl(fd,1,i);          dly(20);          ioctl(fd,0,i);         }         dly(100);                  for(i=3;i>=0;i--)         {          ioctl(fd,1,i);          dly(20);          ioctl(fd,0,i);         }                dly(100);        }	close(fd);  }

⌨️ 快捷键说明

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