Exemplo n.º 1
0
IoObject *IoAppleSensors_getKeyboardBrightness(IoAppleSensors *self, IoObject *locals, IoMessage *m)
{
	/*doc AppleSensors getKeyboardBrightness
		Returns a number for the keyboard brightness.
	*/
	return IONUMBER(getKeyboardBrightness());
}
int
main(int argc, char **argv)
{
    float x;
    float setb;
    /**
    if (argc > 1 && sscanf(argv[1], "%f", &setb) == 1) {
        setKeyboardBrightness(setb);
    }**/
    for (int i = 0; i < 10; i++) {
        x += 0.1;
        usleep(100000);
        printf("%s", "\tSleeping\n");
        setKeyboardBrightness(x);
        printf("%f", getKeyboardBrightness());
    }
  exit(0);
}