Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hugues KADI
laser_game
Commits
5a2bb631
Commit
5a2bb631
authored
Jul 30, 2018
by
attssystem
Browse files
Updated README
parent
9a5420af
Changes
2
Hide whitespace changes
Inline
Side-by-side
LIR_prgm/LIR_prgm.ino
View file @
5a2bb631
...
...
@@ -165,7 +165,7 @@ bool c2 = false;
bool
c3
=
false
;
int
ID
;
int
addR
=
ID
-
1
;
int
channel
;
int
channel
=
1
;
int
addT
;
byte
weaponNb
;
byte
gameTime
;
...
...
@@ -198,6 +198,11 @@ byte dataBytes[5] = {0xA1, 0xF1, ID, 0xAA, 0xAA};
void
setup
()
{
// IR Rx-Tx configuration
Serial
.
begin
(
9600
);
EEPROM
.
get
(
4
,
ID
);
// Screen configuration
...
...
@@ -210,12 +215,13 @@ void setup() {
display
.
clearDisplay
();
display
.
drawBitmap
(
0
,
0
,
logo
,
128
,
32
,
WHITE
);
display
.
display
();
delay
(
30
00
);
delay
(
15
00
);
display
.
setTextSize
(
2
);
display
.
setCursor
(
0
,
0
);
c3
=
askUI
(
"Modifier"
,
"ID ou Freq?"
,
2500
,
c3
);
if
(
c3
==
true
)
{
//c3 = askUI("Modifier", "ID ou Freq?", 2500, c3);
Serial
.
println
(
c3
);
/*if (c3 == true) {
// ID configuration
...
...
@@ -226,7 +232,7 @@ void setup() {
channel = confUI(1, ID, "Freq arme", "", false, channel);
}
}
*/
// nRF24 configuration
...
...
@@ -236,10 +242,6 @@ void setup() {
radio
.
setPALevel
(
RF24_PA_MIN
);
radio
.
startListening
();
// IR Rx-Tx configuration
Serial
.
begin
(
9600
);
// Generic configuration (Inputs-Outputs)
pinMode
(
trigger
,
INPUT_PULLUP
);
...
...
@@ -249,7 +251,7 @@ void setup() {
// Loop code
void
loop
()
{
configuration
();
//
configuration();
play
();
returnStart
();
ending
();
...
...
@@ -316,7 +318,8 @@ bool askUI (char char1[], char char2[], int wait, int configurable) {
display
.
display
();
timeStart
=
millis
();
timeVal
=
0
;
while
(
timeVal
<
wait
&&
c
==
false
)
{
while
(
timeVal
<
wait
&&
configurable
==
false
)
{
Serial
.
println
(
digitalRead
(
trigger
));
timeVal
=
millis
()
-
timeStart
;
if
(
digitalRead
(
trigger
)
==
LOW
)
{
configurable
=
true
;
...
...
README.md
View file @
5a2bb631
# laser_game
\ No newline at end of file
# Laser InfraRed Game (aka LIR Game)
##Based on these technologies :
*
Core
*
Arduino Nano
*
Communications
*
nRF24l01+ (2,4GHz)
*
YIRTM IR Transmitter
*
Interface
*
SD1306 128x64
*
Piezo Buzzer
*
Laser (+220Ohm Resistor)
*
Button (using internal pullup)
*
Power
*
StepUp 3.3v to 5v
*
3000mAh 3.7v Battery
*
Key power switch
##Wiring
TX 31 | | VIN
RX 30 | | GND --- GND IR & nRF24 & Screen
RST 29 | | RST 29
GND | | 5V --- VCC IR + Laser (220 Ohm)
Rx IR --- D2 32 | | A7 22
Tx IR --- D3 1 | | A6 19
CE nRF24 --- D4 2 | Arduino | SCL 28 --- SCL Screen
CSN nRF24 --- D5 9 | Nano | SDA 27 --- SDA Screen
Piezo --- D6 10 | V3 | A3 26
D7 11 | | A2 25
D8 12 | Old | A1 24
Trigger button --- D9 13 | Bootloader | A0 23
D10 14 | | AREF 21
MOSI nRF24 --- D11 15 | | 3V3 --- VCC nRF24 & Screen
MISO nRF24 --- D12 16 | | SCK 17 -- SCK nRF24
##PCB Schematics
Gerber files available in PCB folder
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment