Пример #1
0
void test_led_row_8(monome_t *monome, uint8_t on) {
	unsigned int i;

	for( i = 0; i < 8; i++ ) {
		monome_led_row(monome, 0, i, 1, (uint8_t *) &on);
		chill(16);

		on |= on << 1;
	}

	for( ; i < 16; i++ ) {
		monome_led_row(monome, 0, i, 1, (uint8_t *) &on);
		chill(16);

		on >>= 1;
	}
}
Пример #2
0
void test_led_row_16(monome_t *monome, uint16_t on) {
	unsigned int i;

	for( i = 0; i < 16; i++ ) {
		monome_led_row(monome, 0, i, 2, (uint8_t *) &on);
		chill(16);

		on |= on << 1;
	}
}
Пример #3
0
static int osc_led_col_row_handler(const char *path, const char *types,
                                   lo_arg **argv, int argc,
                                   lo_message data, void *user_data) {
    monome_t *monome = user_data;
    uint8_t buf[2] = {argv[1]->i};

    if( argc == 3 )
        buf[1] = argv[2]->i;

    if( strstr(path, "led_col") )
        return monome_led_col(monome, argv[0]->i, 0, argc - 1, buf);
    else
        return monome_led_row(monome, 0, argv[0]->i, argc - 1, buf);
}
Пример #4
0
int main(int argc, char **argv) {
	monome_t *monome;
	unsigned int w, h, y, s;
	uint16_t buf;

	if( !(monome = monome_open(MONOME_OSC, "8000")) ) {
		fprintf(stderr, "couldn't open monome\n");
		exit(EXIT_FAILURE);
	}

	w = WIDTH;
	h = HEIGHT;

	for(s = 0;; s = !s)
		for( y = 0; y < h; y++ ) {
			buf = ((1 << y)) - s;
			monome_led_row(monome, y, w / 8, y, (uint8_t *) &buf);
			monome_led_set(monome, w - 1, y, random() & 1);
			random_chill();
		}
}