rename and prepare digital input
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
compile:
|
||||
arduino-cli compile -b arduino:renesas_uno:unor4wifi snake.ino
|
||||
arduino-cli compile -b arduino:renesas_uno:unor4wifi ./snake_arduino.ino
|
||||
|
||||
upload:
|
||||
arduino-cli upload -b arduino:renesas_uno:unor4wifi -p /dev/ttyACM0
|
||||
@@ -36,6 +36,14 @@ void setup() {
|
||||
Serial.begin(115200);
|
||||
// stard LED matrix
|
||||
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() {
|
||||
@@ -83,6 +91,9 @@ void move_snake() {
|
||||
frame[snake_y[0]][snake_x[0]]= 1;
|
||||
}
|
||||
|
||||
void change_direction() {
|
||||
}
|
||||
|
||||
void loop() {
|
||||
matrix.renderBitmap(frame, 8, 12);
|
||||
delay(300);
|
||||
Reference in New Issue
Block a user