Improve refresh screen system
This commit is contained in:
parent
ace698b10e
commit
7708bdf06b
12
snake.ino
12
snake.ino
@ -54,7 +54,10 @@ void setup() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(300);
|
||||
for (int i = 0; i < 420; ++i) {
|
||||
refresh_screen();
|
||||
}
|
||||
delay(42);
|
||||
if (!move_snake(read_sensors())) {
|
||||
switch(cur_dir)
|
||||
{
|
||||
@ -219,6 +222,13 @@ void blink(int x, int y)
|
||||
|
||||
}*/
|
||||
|
||||
void write_new_screen(int delay_write, int x, int y) {
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
refresh_screen();
|
||||
}
|
||||
pixels[x][y] = LOW;
|
||||
}
|
||||
|
||||
void refresh_screen() {
|
||||
// iterate over the rows (anodes):
|
||||
for (int thisRow = 0; thisRow < 8; thisRow++) {
|
||||
|
Loading…
Reference in New Issue
Block a user