Пример #1
0
void setup(){
	srandom(analog_read_p(0) + timer_micros() + timer_millis());
	
	//Flash palette
	flash_palette(GRN_1); _delay_ms(100);
	flash_palette(GRN_2); _delay_ms(100);
	flash_palette(GRN_3); _delay_ms(100);
	flash_palette(RED_1 | GRN_3); _delay_ms(100);
	flash_palette(RED_2 | GRN_3); _delay_ms(100);
	flash_palette(RED_3 | GRN_3); _delay_ms(100);
	flash_palette(RED_3 | GRN_2); _delay_ms(100);
	flash_palette(RED_3 | GRN_1); _delay_ms(100);
	flash_palette(RED_3); _delay_ms(100);
	flash_palette(RED_2); _delay_ms(100);
	flash_palette(RED_1); _delay_ms(100);
	
	//Clear board
	clear_scratch();
	flush();
	matrix_write_buffer();
	_delay_ms(100);

	//Random start positions
	for (uint8_t x = 0; x < MATRIX_WIDTH; x++){
		for (uint8_t y = 0; y < MATRIX_HEIGHT; y++){
			if ((random() & 0x3) == 0x3){		//25% chance
				set_scratch(x, y, GRN_1);
			}
		}
	}
	
	for (uint8_t i = 0; i < RECENT_HASH_COUNT; i++){
		recent_hashes[i] = i;
	}
	
	flush();
	matrix_write_buffer();
}
Пример #2
0
uint32_t nrf24_port_current_time_ms(void)
{
    return timer_millis();
}