Introduction: Wireless Arduino Shooting Game
This is an game i made for me to shoot at targets with CO2 guns. My other instructable is to my first version of this game, but with cable and hosting on an Arduino Uno.
This version is a little more bigger and is wireless and cable possible.
The goal with this project is to have an electronic game to shoot at targets. Three game types:
- Quickdraw
- Timed mode
- Rapid fire
It's about the same as my last one but this time it's hosted on an Arduino Mega and i have expand it to save highscore, possible to print result out of an terminal printer, and there is an bigger lcd display.
For updated info and source code to program your arduinos please visit: https://shootinggameblog.wordpress.com
Each targets has Arduino Nano to control the NRF24L01+ transmitter and the sensor to sense a hit.
Follow my guide step by step and you can have your own wireless shooting target game.
This is what you need to make the game:
- 4 shooting targets
- 1 Arduino Mega
- 4 Arduino Nano
- 2 10K Ohm resisto
- 4 Piezo Elements
- 4 Green, Red & Blue led
- 5 nRF24L01+ Transmitter
- 220 ohm resistors
- 100 uF capacitor (for the transmitter)
- 8 Schottky Diods 1N5817
- 4 Zener Diods TZX5V1B-TAP
- 4 1M Ohm Resistors
- 4 Ceramic Capacitors 0.01 uF
Step 1: Making the Wireless Sensors
You can make the sensors either by placing them right on the target with all electronic inside. Or just the cable sensor version where you place an cable (3.5 mm phono) between the target and the transmitters. (this version i use now)
The sensors is loaded with target code, each sensor have unique numbers to listen to so they know when they will be activated. There is just one code needed. All you need to do is to change on top in the code DEFINE SENSOR1 to the specified sensor. The system is built for 4 targets.
The code is available on GitHub.
The piezo is used to feel the vibration on target. When the bullet hits the target, the vibration will inform arduino that an hit is made.
The wireless sensor have three leds (depending on how you build them. The red one is for to indicate that there is problem transmitting, the green one is for success transmitting, and the blue to inform you that target is activated.
When the game send out an signal, the arduino will go in an knock loop to wait for the piezo to inform the arduino that an hit is made. When the hit is made it will start sending back an special code to the main system that is waiting for the transmitter. Follow the electric sheets to make the sensor, and flash the arduino with the software.
Your target is then ready, and you can use cables also if you don't want wireless sometimes.
Step 2: Making the Main System
The main system i have build inside a water proof case.
- It has 4 push buttons
- Two rotary switchs
- One power button
- A battery holder
- 4 phono contacts
- 20x4 lcd display
- Terminal printer
- RTC module
- SD Card module
- 1 Transmitter
This is the main system that holds the game. You can use it with wireless or with cables. Follow the electric sheet to connect everything.
What it have is three game modes:
- Quickdraw (Shoot as fast as you can on the right target)
- Timed Mode (Shoot so much you can in 10, 20 or 30 sec)
- Rapid Fire (Hit 6, 10, 20 or 32 targets on fastest time)
I have made it possible to run on 9v power and 9v battery.
The terminal printer is to print out the result for a game, it even store the high score on an SD card.
It's important to place an capacitor on 3.3v and ground on the transmitter or else you will get problems with transmitting due to powerlost. Also there is good to shield it with aluminum foil to protect it so the other electronic don't disturb the transmitter. (Don't forget to take some plastic foil first on it. I have written more about this on the blog page (link on top.)
Visit my blog page for get updated info on the game, and the source code to program your arduino.
Step 3: Use the Game
When you build everything there is just one more thing to do, play with it. And always wear protection when shooting.
When you startup the game, you will have to choose if you are going to use wireless or cable.
If you are going to use wireless, start the sensors first, and then the game.
After selecting the wireless mode, it will send an test signal to each sensor to confirm that they got connection.
What it does is that the main system will send out an code, each sensor have there own code. And when they get the right code they send another code back to confirm.
Now you can play, select game and start playing with the game switch and press start button.
There is an menu button also (by pressing the OK button) where you can setup options for game, see high score, set the clock and other stuff.
When a game is finish you get an option to print out the result for the game if you use the terminal printer.
If you are going to use the cable version, insert the 3.5 mm phono cables to the sensors and then in the main system.
And on the startup you choose the cable version.
Good luck and if you have any question write an comment or send me an mail.
21 Comments
3 years ago
Hi, I made this and it works very well. There are a couple of errors on the wiring diagram which gave a little issue with the NRF communications etc. and I changed the print statements so I could send the results to my android phone via bluetooth (I used a HC-06) . If i get time I will add a couple of extra routines and maybe an option to use just 1 wireless sensor (it currently requires the 4 or just hangs). Anyway, well done on the design, it saved me a huge amount of work and is fun to use.
Cheers
David
Reply 3 years ago
For anybody else trying to make this - you will need to edit the SdFatconfig.h file and set “#define ENABLE_SOFTWARE_SPI_CLASS 0 to 1 in order to change it from the default setting of hardware spi. If you dont do this you will get the compile errors as mentioned elswhere.
cheers
David
Reply 1 year ago
Hi David,
The SdFatconfig.h file doesn't contain the line “#define ENABLE_SOFTWARE_SPI_CLASS..". Or am I supposed to add the line somewhere in the file? If so, I don't know where to add it.
Regards
Jeroen
Reply 1 year ago
David
Reply 1 year ago
Ah bonjour! Especially nothing to do during last covid-winter! ;)
Anyway, I have found the reason why mine SdFatconfig.h file missed the line.
In the library manager I have "downgraded" the SdFat library to the oldest version available. (In my case ver. 1.01)
In this version the line excists and after your modification, the compile errors are gone. :)
Another challenge occurs, is it even possible to add more targets to this version? (Not the Raspberry Pi version)
Regards
Jeroen
Reply 1 year ago
Hi, Glad its sorted. I did check my system and the line was in. Not sure about adding more targets, I used 4 and was happy with it. Comms with NRF24 units can be a little hit and miss due to the huge amount of copied modules available so I was quite happy to have 4 working reliably. I only changed to the pi version out of curiosity. Enjoy it, it's a fun game.
Regards
David
Reply 1 year ago
Hi David,
Final question ;)
Did you make any modifications to the wiring or code of de NRF24-modules?
The main set and the targets are unable to connect. I even swapped the modules in case there were broken modules among them, but no luck.
As a final attempt I will try a seperate power source for the module on the Mega due to it's crappy 3.3v output (so I have heard..).
Regards
Jeroen
Reply 1 year ago
Hi, Yes, I recall the wiring to the NRF is wrong on the diagram. If you check the diagram and compare it to the arduino code you should see the issue with the difference in pin outs.
I really recommend checking the NRF units separately with some test code - even when wired correctly they can be a PITA.
If you still have issues let me know and I will dig my unit back out.
Regards
David
Reply 1 year ago
Hi David,
Great succes! I made a send-receive test setup and tested all of the modules I have; 4 out of 10 was broken. :(
After some re-wiring and -coding, the connection test was succesful. :D
To be continued..
Regards
Jeroen
Reply 1 year ago
Hi, Glad its sorted, enjoy!
Regards
David
Reply 1 year ago
OK thx.
I'll try to see how much more wireless targets it will accept.
Regards
Jeroen
3 years ago
always the same problem !! if we remove this sd card completely it is not necessary. how we do it ?
4 years ago
Hi, Andreas.
Thank you for sharing this project. I'm trying to build your target system.
But I get an error: "'SdFatSoftSpi' does not name a type" ( SdFatSoftSpi SD;)
I downloaded all the libraries and put them in "my documents/arduino/library" I added "SdFat library but I have still same error message.
I couldn't solve this problem. I want to do it .I try everyhing. I tried to install sketch on another computer but I didn't get any result. I get the same error. Other users have received the same errors like me. What can I do? help me please.
Please Andreas help.
Reply 3 years ago
If you still have a problem with this (I did!) let me know and I will dig out what I did to resolve it.
Regards
David
4 years ago
Hi Andreas,
I'm trying to build ketchthis project. I'm in the testing phase and trying to upload the the sketch, but I get the following error. I have installed the lib. manually as per your instructions. Please help. Thanks in advance.
Arduino: 1.6.11 (Windows 8.1), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
ShootingEnglish_Final:35: error: 'SdFatSoftSpi' does not name a type
SdFatSoftSpi<SOFT_MISO_PIN, SOFT_MOSI_PIN, SOFT_SCK_PIN> SD;
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void setup()':
ShootingEnglish_Final:336: error: 'SD' was not declared in this scope
if (!SD.begin(SD_CHIP_SELECT_PIN)) {
^
ShootingEnglish_Final:401: error: 'SD' was not declared in this scope
if (SD.exists("rsset.txt")) {
^
ShootingEnglish_Final:432: error: 'SD' was not declared in this scope
if (SD.exists("htime.txt")) {
^
ShootingEnglish_Final:482: error: 'SD' was not declared in this scope
if (SD.exists("htime2.txt")) {
^
ShootingEnglish_Final:532: error: 'SD' was not declared in this scope
if (SD.exists("htime3.txt")) {
^
ShootingEnglish_Final:582: error: 'SD' was not declared in this scope
if (SD.exists("hqu.txt")) {
^
ShootingEnglish_Final:676: error: 'SD' was not declared in this scope
if (SD.exists("hrap.txt")) {
^
ShootingEnglish_Final:724: error: 'SD' was not declared in this scope
if (SD.exists("hrap1.txt")) {
^
ShootingEnglish_Final:772: error: 'SD' was not declared in this scope
if (SD.exists("hrap2.txt")) {
^
ShootingEnglish_Final:820: error: 'SD' was not declared in this scope
if (SD.exists("hrap3.txt")) {
^
ShootingEnglish_Final:868: error: 'SD' was not declared in this scope
if (SD.exists("s1.txt")) {
^
ShootingEnglish_Final:880: error: 'SD' was not declared in this scope
if (SD.exists("s2.txt")) {
^
ShootingEnglish_Final:890: error: 'SD' was not declared in this scope
if (SD.exists("s3.txt")) {
^
ShootingEnglish_Final:900: error: 'SD' was not declared in this scope
if (SD.exists("s4.txt")) {
^
ShootingEnglish_Final:911: error: 'SD' was not declared in this scope
if (SD.exists("tset.txt")) {
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void doTimedMode()':
ShootingEnglish_Final:1617: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:1634: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:1651: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
ShootingEnglish_Final:1673: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:1690: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:1707: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
ShootingEnglish_Final:1729: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:1746: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:1763: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
ShootingEnglish_Final:1786: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:1803: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:1820: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void doTimedModeW()':
ShootingEnglish_Final:2319: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:2336: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:2353: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
ShootingEnglish_Final:2375: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:2392: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:2409: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
ShootingEnglish_Final:2431: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:2448: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:2465: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
ShootingEnglish_Final:2488: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
ShootingEnglish_Final:2505: error: 'SD' was not declared in this scope
SD.remove("htime2.txt");
^
ShootingEnglish_Final:2522: error: 'SD' was not declared in this scope
SD.remove("htime3.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void doRapidFire()':
ShootingEnglish_Final:2747: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:2763: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:2781: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:2797: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:2815: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:2831: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:2849: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:2865: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:2890: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:2906: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:2924: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:2940: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:2958: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:2974: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:2992: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:3008: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:3033: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3049: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3067: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:3083: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:3101: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:3117: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:3135: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:3151: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:3176: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3192: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3210: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:3226: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:3244: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:3260: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:3278: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:3294: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void doRapidFireW()':
ShootingEnglish_Final:3816: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3832: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3850: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:3866: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:3884: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:3900: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:3918: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:3934: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:3959: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3975: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:3993: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:4009: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:4027: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:4043: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:4061: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:4077: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:4102: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:4118: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:4136: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:4152: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:4170: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:4186: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:4204: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:4220: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:4245: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:4261: error: 'SD' was not declared in this scope
SD.remove("hrap.txt");
^
ShootingEnglish_Final:4279: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:4295: error: 'SD' was not declared in this scope
SD.remove("hrap1.txt");
^
ShootingEnglish_Final:4313: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:4329: error: 'SD' was not declared in this scope
SD.remove("hrap2.txt");
^
ShootingEnglish_Final:4347: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
ShootingEnglish_Final:4363: error: 'SD' was not declared in this scope
SD.remove("hrap3.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void doQuickDraw()':
ShootingEnglish_Final:4760: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:4805: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:4860: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:4905: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:4960: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:5005: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:5060: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:5105: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void doQuickDrawW()':
ShootingEnglish_Final:5785: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:5830: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:5885: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:5930: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:5985: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:6030: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:6085: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
ShootingEnglish_Final:6130: error: 'SD' was not declared in this scope
SD.remove("hqu.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void timeHigh()':
ShootingEnglish_Final:6930: error: 'SD' was not declared in this scope
hquickFil = SD.open("htime.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void rapidHigh()':
ShootingEnglish_Final:7134: error: 'SD' was not declared in this scope
hquickFil = SD.open("hrap.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void quickHigh()':
ShootingEnglish_Final:7425: error: 'SD' was not declared in this scope
hquickFil = SD.open("hqu.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void printRapid()':
ShootingEnglish_Final:7608: error: 'gun2_width' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:7608: error: 'gun2_height' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:7608: error: 'gun2_data' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void printTimed()':
ShootingEnglish_Final:7756: error: 'gun2_width' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:7756: error: 'gun2_height' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:7756: error: 'gun2_data' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void printQuick()':
ShootingEnglish_Final:7910: error: 'gun2_width' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:7910: error: 'gun2_height' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:7910: error: 'gun2_data' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void printHigh()':
ShootingEnglish_Final:8196: error: 'gun2_width' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:8196: error: 'gun2_height' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
ShootingEnglish_Final:8196: error: 'gun2_data' was not declared in this scope
printer.printBitmap(gun2_width, gun2_height, gun2_data);
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void setRapidFire()':
ShootingEnglish_Final:8681: error: 'SD' was not declared in this scope
SD.remove("rsset.txt");
^
ShootingEnglish_Final:8688: error: 'SD' was not declared in this scope
SD.remove("rsset.txt");
^
ShootingEnglish_Final:8695: error: 'SD' was not declared in this scope
SD.remove("rsset.txt");
^
ShootingEnglish_Final:8702: error: 'SD' was not declared in this scope
SD.remove("rsset.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void setTimedTime()':
ShootingEnglish_Final:9192: error: 'SD' was not declared in this scope
SD.remove("tset.txt");
^
ShootingEnglish_Final:9200: error: 'SD' was not declared in this scope
SD.remove("tset.txt");
^
ShootingEnglish_Final:9208: error: 'SD' was not declared in this scope
SD.remove("tset.txt");
^
C:\Users\Dad\Desktop\arduino sketches\ shooting game with printer\Shooting-Sensor-master\Main\ShootingEnglish_Final\ShootingEnglish_Final.ino: In function 'void resetHighscore()':
ShootingEnglish_Final:9242: error: 'SD' was not declared in this scope
SD.remove("htime.txt");
^
Multiple libraries were found for "Wire.h"
Used: C:\Users\Dad\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\libraries\Wire
Not used: C:\Users\Dad\Documents\Arduino\libraries\Wire
exit status 1
'SdFatSoftSpi' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Reply 4 years ago
Hi it looks like you don’t have the SDFat Library installed in your arduino. Just Google for SDFat arduino and you will find it.
5 years ago
Hi Andreas,
I'm trying to build the target system. I'm pretty new to the arduino platform. I've orderd all the parts an wanted to upload the main to my arduino mega but I get an error. "'SdFatSoftSpi' does not name a type" I would assume that just uploading the file would be enough to make it work. Am I missing something here?
Thanx in advange.
Reply 5 years ago
Hi.
You need to add SDFat Library in Arduinos Library folder. There is a link to it on GitHub page.
Good luck
/Andreas
Reply 5 years ago
Thank you for your reply, i've followed the readme file and downloaded all the libraries and put them in "my documents/arduino/library" or do I need to install them somehow?
Thanx in advange
Reply 5 years ago
Yes you place the Library there, you need to restart arduino after that. SD Fat Library is for the SD Reader Module. I use that becouse it support soft serial.