Created
August 14, 2013 01:45
-
-
Save freekode/6227350 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fcntl.h> | |
#include <unistd.h> | |
#include <linux/kd.h> | |
#include <sys/ioctl.h> | |
#include <stdio.h> | |
#include <time.h> | |
int main() { | |
int fd,j,k; | |
float i; | |
static ledSet[3] = {2,4,1}; | |
if ((fd = open("/dev/console", O_NOCTTY)) == -1) //открываем хз что | |
return(-1); | |
ioctl(fd, KDSETLED,0); //вырубим все нафиг, куда посылаем KDSETLEDб что посылаем 0 | |
for (i=1;i>=0.1;i-=0.1) { //цветомузыка | |
for(j=0;j<=2;j++) { | |
//printf ("\nfl=%f",i); | |
ioctl(fd, KDSETLED,ledSet[j]); | |
usleep(i*1000000); | |
} | |
ioctl(fd, KDSETLED,0); | |
//printf ("\n%f",i); | |
} | |
for (k=0;k<=10;k++) { //цветомузыка | |
for(j=0;j<=2;j++) { | |
//printf ("\nfl=%f",i); | |
ioctl(fd, KDSETLED,ledSet[j]); | |
usleep(i*1000000); | |
} | |
ioctl(fd, KDSETLED,0); | |
//printf ("\n%f",i); | |
} | |
printf ("gg\n"); | |
usleep(0.7*1000000); | |
ioctl(fd, KDSETLED,7); //врубим все нафиг | |
usleep(1.5*1000000); | |
ioctl(fd, KDSETLED,0); //вырубим все нафиг*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment