rename and prepare digital input
This commit is contained in:
@@ -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
|
||||||
@@ -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);
|
||||||
Reference in New Issue
Block a user