Mod edit:
See I am trying to make a simple IR sensor shooting game
I would like to get a estimate on some code for something like this
the goal for the code is to make a Arduino IR shooting game with six targets(different targets will add different point amounts). the elegoo remote (elegoo is temporary and i think i am going to use a IR transmitter connected to a nano) will be clicked by someone playing and then the the IR sensor will detect a signal from the remote and then the corresponding (each target has one IR sensor and one servo) sg90 servo motor will "fall"(move) backwards it will stay at this position for a second(maybe less) and then move back to is original position and while all of this is happening there will be a tm1687 seven segment display that detects every time a target(ir+sg90 servo grouping) is "hit" (detects a signal) and will add a point with the help of a point counting code for displaying the points on a tm1637
also I only have access to Arduino 1.8.19 and Arduino IDE 2.0.4 so it needs to work with specifically one of these versions.
the parts:
- a nano
- for the ir sensor and transmitter will be a Gikfun Digital 38khz for both
- the servo is a sg90
- my IR remote is just a elegoo remote I also did not buy it so I do not know where to look. It does however look like this type
- and a tm1687 seven segment display to display points
this is what I want it too look like
the pin connections are 100% flexible but here are the ones in the picture:
IR sensor 1 in wired to A0. Servo 1 is wired to D13
IR sensor 2 is wired to A1. Servo 2 is wired to D12
IR sensor 3 is wired to A2. Servo 3 is wired to D11
IR sensor 4 is wired to A3. Servo 4 is wired to D10
IR sensor 5 is wired to A4. Servo 5 is wired to D9
IR sensor 6 is wired to A5. Servo 6 is wired to D8
the TM1687 DIO pin is wired to D7
the TM1687 CLK pin is wired to D6
the numbers assigned to each component represent one grouping(target). the matching numbers are for which motor should be controlled by which IR sensor.
when powering it the main target is not going to move so i think I am just gonna have a extension cord and a Arduino usb to arduino cable with a adapter to outlet on the usb side(I live in America so keep our outlets in mind and not the Europeans)