rename and prepare digital input

This commit is contained in:
andrea
2023-11-04 10:32:44 +01:00
parent 9df7da3a96
commit e337c32ec4
2 changed files with 12 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
compile: compile:
arduino-cli compile -b arduino:renesas_uno:unor4wifi snake.ino arduino-cli compile -b arduino:renesas_uno:unor4wifi ./snake_arduino.ino
upload: upload:
arduino-cli upload -b arduino:renesas_uno:unor4wifi -p /dev/ttyACM0 arduino-cli upload -b arduino:renesas_uno:unor4wifi -p /dev/ttyACM0

View File

@@ -36,6 +36,14 @@ void setup() {
Serial.begin(115200); Serial.begin(115200);
// stard LED matrix // stard LED matrix
matrix.begin(); matrix.begin();
// btn up
pinMode(13, INPUT);
// btn right
pinMode(12, INPUT);
// btn bottom
pinMode(11, INPUT);
// btn left
pinMode(10, INPUT);
} }
void move_snake() { void move_snake() {
@@ -83,6 +91,9 @@ void move_snake() {
frame[snake_y[0]][snake_x[0]]= 1; frame[snake_y[0]][snake_x[0]]= 1;
} }
void change_direction() {
}
void loop() { void loop() {
matrix.renderBitmap(frame, 8, 12); matrix.renderBitmap(frame, 8, 12);
delay(300); delay(300);