-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path1dpong.ino
54 lines (45 loc) · 1.54 KB
/
1dpong.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* 1D Pong - Pong-like game run on an Arduino MCU
* Copyright (C) 2018 Stephan Riedel - [email protected]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// 1dpong.ino
#include "Pong.h"
// Player settings
const uint8_t LIFES = 8;
const uint16_t BUTTON_LOCK_TIME = 1000;
const uint16_t RESTART_LOCK_TIME = 1000;
// FastLED settings
const uint8_t NUM_LEDS = 60;
const double STRIPE_LENGTH = 1.0;
//const EOrder LED_COLOR_ORDER = BGR;
//const ESPIChipsets LED_TYPE = APA102;
const uint8_t BRIGHTNESS = 64; //max. 255
// Digital pins settings
const uint8_t RESTART_PIN = 7;
const uint8_t PLAYER1_PIN = 8;
const uint8_t PLAYER2_PIN = 9;
// Random settings
const uint8_t RANDOM_SEED_PIN = 6;
Pong pong(PLAYER1_PIN, PLAYER2_PIN, LIFES, BUTTON_LOCK_TIME,
NUM_LEDS, STRIPE_LENGTH, BRIGHTNESS,
RESTART_PIN, RESTART_LOCK_TIME, RANDOM_SEED_PIN);
void setup() {
Serial.begin( 9600 );
Serial.println("Starting Pong!");
}
void loop() {
pong.game_logic();
}