#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char **argv)
{
  int fd;
  int one=1,zero=0,all=255;
  char arg;

  fd = open("/dev/ibus1", O_RDWR);
  if(fd == -1) {
    fprintf(stderr, "Error: could not open /dev/ibus1 for reading.\n");
    exit(1);
  }

  do{
    printf("Hit a key to check LEDs!");
    arg = getchar(); 
    write(fd, &all, 1);
    usleep(1);
    write(fd, &zero, 1);
  }while (arg!='q');
  close(fd);
  return 0;
}

