Skip to content

Instantly share code, notes, and snippets.

@freekode
Created August 14, 2013 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freekode/6227350 to your computer and use it in GitHub Desktop.
Save freekode/6227350 to your computer and use it in GitHub Desktop.
#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