Heng Long 1/30th tank code problem

Discuss the good old Heng Long electronics here, whether its mods on them or anything else, it goes here!
User avatar
SirLAL
Recruit
Posts: 7
Joined: Wed Feb 28, 2024 1:56 am

Heng Long 1/30th tank code problem

Post by SirLAL »

Hi I'm brand new to Tanks and just wanted to know if anyone knows how to update the code for Heng Long 1/30 tanks. The tanks I have send an IR signal for Tamiya when cannon is shot. The mini gun does not get recognized in the code though. I uploaded the IRremote test dump code and it picks up a repeating signal so there should be a way to update the library. I realize this thread is very old, but I'm hoping someone still is monitoring for those new to this. Here is what the mini gun is dumping out:

Protocol=UNKNOWN 1 bits (incl. gap and start) received
Received noise or an unknown (or not yet enabled) protocol
rawData[2]:
-3276750
+5050
Sum: 5050

Protocol=UNKNOWN 3 bits (incl. gap and start) received
Received noise or an unknown (or not yet enabled) protocol
rawData[6]:
-33850
+19000,-5000
+9950,-5000 +4950
Sum: 43900

Protocol=UNKNOWN 3 bits (incl. gap and start) received
Received noise or an unknown (or not yet enabled) protocol
rawData[6]:
-33950
+18950,-5000
+10000,-5000 +4950
Sum: 43900

Protocol=UNKNOWN 1 bits (incl. gap and start) received
Received noise or an unknown (or not yet enabled) protocol
rawData[2]:
-34000
+18950
Sum: 18950
User avatar
Son of a gun-ner
Lieutenant-Colonel
Posts: 6955
Joined: Sun May 07, 2017 8:49 pm
Location: Surrey UK

Re: Heng Long 1/30th tank code problem

Post by Son of a gun-ner »

SirLAL wrote: Wed Feb 28, 2024 2:08 am I realize this thread is very old, but I'm hoping someone still is monitoring for those new to this.
Also the thread was unrelated to your tanks electronics.
Therefore I removed your post.
Unless you neglected to tell us your tank's electronics have been changed to Arduino?
SirLAL wrote: Wed Feb 28, 2024 2:08 am Hi I'm brand new to Tanks
Not just tanks it would appear :/

Courteously saying hi in the Introduce Yourself section like the welcome message suggests, always goes a long way with the longer standing members, before wanting to borrow their metaphorical lawn mower.
Mick - The grit in the underpants of life!
And always happy to spare the bytes

TOTM needs YOU :thumbup: support YOUR TOTM competition, I'm doing my part, are YOU?
User avatar
LukeZ
Lance Corporal
Posts: 178
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: Heng Long 1/30th tank code problem

Post by LukeZ »

Hi SirLAL, it sounds like you are trying to receive IR cannon fire from your 1/30th scale Heng Long tanks with the Open Panzer TCB (or maybe the Open Panzer standalone IR project).

Either way, from the information you posted, it appears these 1/30th tanks are using the same protocol as the full sized Heng Long tanks. It is not the Tamiya protocol.

If you set your Open Panzer device to the Heng Long protocol I suspect you will be able to register a hit from the 1/30th tank.

LukeZ
NO SUPPORT THROUGH PM - read why
User avatar
SirLAL
Recruit
Posts: 7
Joined: Wed Feb 28, 2024 1:56 am

Re: Heng Long 1/30th tank code problem

Post by SirLAL »

Hi All,
I think an admin moved my post. I originally posted it under "How to build a working IR Artillery Gun" and yes the tanks do register hits on the Arduino from Cannon shots. What I'm trying to find out is if I can get the machine gun to register. There only two options in the code for Machine gun fire and neither register a response. I then loaded the IRremote project just see what was being received and that is what I had originally posted.

Just for reference this is from the A_setup.h file in the TankIR project. I set the MG to true as it is defaulted to False and then tried the two options given with no luck:

#define IR_MG_PROTOCOL IR_MG_CLARK // << --- SET ME
#define MG_DAMAGE true // << --- SET ME - Whether or not this device will accept machine gun damage

// Options are:
// IR_MG_CLARK // Machine gun: Clark protocol (Sony)
// IR_MG_RCTA // Machine gun: RCTA protocol
Last edited by SirLAL on Wed Feb 28, 2024 11:20 pm, edited 1 time in total.
User avatar
SirLAL
Recruit
Posts: 7
Joined: Wed Feb 28, 2024 1:56 am

Re: Heng Long 1/30th tank code problem

Post by SirLAL »

Hi LukeZ,
Here is why I think they register as Tamiya, this is what is outputted from cannon fire:
BATTLE INFO
---------------------------------------------
Is Repair Tank? No
Fire Protocol: Tamiya
Hit Protocol 2: Heng Long
Repaired by: Clark Repair
Send MG IR Code: No
Accept MG Damage: Yes (Clark Machine Gun)
Damage Profile: Tamiya Spec
Weight Class: Medium
(6 cannon hits, 5.0 sec reload, 12.0 sec recovery)



CANNON HIT! (Tamiya)
Health Level: 83%
CANNON HIT! (Tamiya)
Health Level: 67%
CANNON HIT! (Tamiya)
Health Level: 50%
User avatar
LukeZ
Lance Corporal
Posts: 178
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: Heng Long 1/30th tank code problem

Post by LukeZ »

Hi SirLAL, well there are two things going on. First is that the Arduino is interpreting canon fire from the HengLong tank as being the Tamiya protocol. I am almost certain this is incorrect. Possibly it is a bug in the code that is showing the Tamiya protocol because that is what you have assigned as the primary cannon protocol, instead of Heng Long which is defined as the alternate, even though it is the Heng Long that is being received. Due to the nature of the signals, it is also possible that one signal is being confused for another.

To clear this up, go to the A_Setup.h file in the Arduino project, and set the IR_FIRE_PROTOCOL to Heng long like this:

Code: Select all

#define IR_FIRE_PROTOCOL    IR_HENGLONG
Now try shooting the Arduino with your Heng Long cannon, does it register a hit? If so this confirms that the Heng Long is sending the Heng Long signal.

The second issue is what is the Heng Long sending for machine gun IR. No other Heng Long tank that I know of uses IR for the machine gun, and if these tanks do, that makes them an exception. To really figure out what they are doing, I would need to put one of these tanks on a scope but as I don't have one of these tanks that isn't something I can do. The test dump information you posted at the beginning is partly garbled (which is normal, not all reception is clear), but the parts that are clear, clearly show the standard Heng Long cannon protocol. So it is my guess that if the machine gun is indeed sending any IR signal, it is just the same signal as the regular cannon signal.

As you saw, we don't have an option for any Heng Long machine gun protocol, but even if we did, if they are using the same protocol for cannon and machine gun, then even if you fire the machine gun the Arduino would simply interpret it as a cannon hit.

I think you will probably have to content yourself with the cannon IR functionality and forget about the machine gun.
NO SUPPORT THROUGH PM - read why
User avatar
SirLAL
Recruit
Posts: 7
Joined: Wed Feb 28, 2024 1:56 am

Re: Heng Long 1/30th tank code problem

Post by SirLAL »

Hi LukeZ,
Thanks for the feedback. I tried what you suggested and it didn't register any hits. I then changed it back to Tamiya and it registered the hits. I guess Heng Long has borrowed Tamiya's code for this little tank.
For my purpose right now I'm content with what it has, I just had grander plans but that is OK because this won't take up as much time and as I'm doing this with my 12-year-old... well sometimes attention spans don't last long :)
Just out of curiosity, what do other tanks use to register machine gun hits, other than IR signals? I only have used the Arduino for a couple hours looking into the IR signals, but wondering if we get other tanks will we be able to expand on our work with different sensors.
User avatar
LukeZ
Lance Corporal
Posts: 178
Joined: Sat Apr 17, 2010 8:03 pm
Contact:

Re: Heng Long 1/30th tank code problem

Post by LukeZ »

Hi SirLAL, well that is interesting they decided to use Tamiya on these tanks, but only for cannon IR. From your first post it would seem they are using the standard Heng Long IR signal for machine gun fire, which is even more strange.

As for other models using IR for cannon fire, in my testing the vast majority of board makers don't use anything. I was only able to find two that did - the RC Tanks Australia Mako 2 (which used their own special protocol), and the Clark, which used a Sony standard TV remote protocol for machine gun IR (I only tested the TK-22 but I assume it is similar for their other boards).

As for the others (Tamiya, Taigen, IBU, and others including Heng Long except for apparently your 1/30 scale tanks), no IR is transmitted with machine gun fire. Consequently MG IR is not used in standard tanks battles, and basically the only functionality is a blinking LED for visual effect. I'd think even the lightest tanks back even from WWI would have been impervious to machine gun fire, which was more or less the point when they invented the tank in the first place!
NO SUPPORT THROUGH PM - read why
User avatar
SirLAL
Recruit
Posts: 7
Joined: Wed Feb 28, 2024 1:56 am

Re: Heng Long 1/30th tank code problem

Post by SirLAL »

Hi LukeZ,
Just wanted to let you know that I was able to complete the project and let you know I appreciated the assistance. Added a little GIF to show the bunker in action.
Attachments
ezgif-6-45ed5b45ba.gif
ezgif-6-45ed5b45ba.gif (2.49 MiB) Viewed 96 times
User avatar
Herr Dr. Professor
Lieutenant
Posts: 3699
Joined: Mon Apr 22, 2019 10:48 pm
Location: Southern Wisconsin USA

Re: Heng Long 1/30th tank code problem

Post by Herr Dr. Professor »

Ooh! I would have gone bananas over that action 60 years ago. Fast forward 60 years :crazy: :thumbup: :thumbup: :haha:
Post Reply

Return to “Heng Long”