LukeZ wrote:There are two issues here and they are not related.
1. Servo
For now do no bother testing the servo with the RX-18, use only the manual button to ground.
First, re-download the firmware from GitHub. I made a few changes that should eliminate some of the warnings the IDE was giving you earlier. I don't think they will make any difference to the servo, but it won't hurt.
Second, attach the servo as you have done (Sig to D8, Positive to Uno 5V, Negative to Uno Ground). Now test by momentarily bringing D4 to Ground. But it is not enough to simply say, "the servo does nothing"! I need to know whether putting D4 to Ground while the servo is attached does anything at all. Does it send the IR successfully, but not the servo? Or does it do neither? In other words, does everything work except the servo, or does connecting the servo cause nothing to work?
Installed 1.8.2, the latest version, threw up a load of warnings, but the Sketch uploaded.
Tried the servo test, but the servo was still dead.
Hmm...went and got another one (I have four new ones), plugged that in, and the damned thing worked! It was a dead new servo.
So, using the momentary button with the Uno hooked up to the PC via the USB, the servo is active.
I already know that the IR emitter works when the Uno is hooked up to the PC via the USB.
2. RX-18 Trigger
First, do NOT attach both RX-18 IR connections to the Uno! Especially do not connect one of them to ground. The RX-18 IR negative is an output, it is not a Ground connection. You could damage your RX-18 by connecting it to ground and firing the cannon as you have done.
The neg is not connected the molex pin has been disconnected. There is only one wire in the 5 pin plug, that is the IR+.
We may not get the RX-18 to work with the Uno, but if we do you only need to connect a single wire from the RX-18 to Uno A0 for the trigger. There is no looping back required, that is not how these electronics work. What we need to do is figure out which wire from the RX-18 might give us an adequate signal. You have assumed the positive IR signal from the RX-18 and that is a reasonable guess but it may not be correct. Try the following steps:
Ok, trying the following:
1. Disconnect the servo so we know that isn't causing any problems.
Done - Servo disconnected
2. Test fire the IR emitter (or just keep the Uno connected to your computer and watch the serial monitor) using the manual switch from D4 to Ground, to make sure the board is working correctly. The emitter should fire.
Yes it fires when connected to the USB and activated via the momentary button.
3. Next test fire the emitter by using a jumper to manually and momentarily connect A0 to +5v on the Uno. This lets us test if the firmware is reading A0 correctly. If it fires, proceed.
Yes it fires the emitter.
4. Now connect RX-18 IR positive wire (connector CN2-A on the RX-18) to Uno A0 (through a 10k resistor with another 10k to ground as you had earlier). Leave the RX-18 IR negative wire (CN2-B) disconnected! Now fire the cannon with your Heng Long transmitter. Does the Uno respond? Ie, does the serial monitor indicate anything?
No, the serial monitor remains blank.
The emitter does not function.
The onboard led does not flash.
5. If not, try the other way. Connect RX-18 IR negative (connector CN2-B on the RX-18) to Uno A0. Yes, I really said connect IR negative to A0. Leave the RX-18 IR positive wire (CN2-A) disconnected! Again try firing the cannon with the HL transmitter, and see if the Uno responds.
No, the serial monitor remains blank.
The emitter does not function.
The onboard led does not flash.
6. If that doesn't work, try connecting the RX-18 strobe output (CN3-G) to the Uno A0. This provides a clean 5v trigger source, the only drawback is that the RX-18 will probably only send the trigger if you have an airsoft attached. Maybe you don't want to use an airsoft but just attach one for this test (I believe the RX-18 needs to get the signal from the limit switch on the back of the airsoft unit before it will send the strobe signal).
You will never guess what I pulled out of the tank because I thought I would never need it....will resume test when I have re-established the circuit.
I didn't design this with the idea of integrating it with the RX-18, nor have I tested it (unfortunately I do not have an RX-18 right now or I would). There's no guarantee the two are going to be (easily) compatible. But let's see what the above produces.
I can appreciate that, my thoughts are that if a Uno or Nano can give someone access to IR battling then it gets them into the hobby, and the more people there are, the bigger the hobby becomes. This benefits everyone.
I'll post an update when I have sorted out a temporary loom for the strobe. This would really be the better option if I can get around the microswitch trigger, as the RX18 IR +/- can be used to power a high intensity muzzle flash led (which was why I assumed they were pos and neg).