I think we may have been slightly at cross purposes, so just to clarify and to put the derived id numbers in perspective, my chassis has an 11 pin Shtok connector on the front of it, wired so that connector LEDs and blade data pin are in parallel.
The front section of the hilt has a second Shtok connector, this time a 7 pin eco version, again wired so that connector LEDs and blade data pin are in parallel. The blade detect wire is obviously only fitted to the connector on the main body to tell when the front section has been added.
When the chassis is together to complete the hilt, both Shtok connectors are linked together in parallel on their way to the main blade if that makes sense.
This diagram shows the layout:
I don’t know if it’s relevant, but part of my tail chasing has been tracked to the id command giving slightly different bladeid figures depending on whether the board was loaded with a config that ran scanid every second compared with one that didn’t.
You can see the below as a chart (hope that’s OK Prof, but the chart makes it easier to see the comparison). The command used in Serial monitor to get these numbers was simply ‘id’. The single numbers show that those numbers didn’t deviate very much between multiple id requests:
The only difference between configs was one had these defines added and one didn’t:
// #define BLADE_ID_SCAN_MILLIS 1000
// #define BLADE_ID_TIMES 10
One reason I’ve been struggling to differentiate the KR blade from no blade fitted is that there is an overlap of derived id numbers.
However if I leave out the line
#define NO_BLADE_ID_RANGE…
and then use only three modes (chassis alone, chassis in hilt with or without blade, and charge plug) then make the bladeid number in the blade array pretty low, but far enough from the charge plug number, then everything works as I want it. Blade detect tells the board whether the chassis is fitted or not, and the setup for hilt and hilt with blade is the same, but the charge plug is still recognized as different.
CONCLUSION
So for my money, and allowing for the fact that I appear to have grasped various sticks in this forest firmly by the wrong end, if any changes were to be made to this, I would say the following might be worth thinking about:
-
Add a define so the user can select whether changes in bladeid status trigger the bladein wav to be played or the font wav to be played. Or maybe revert back to how I believe it used to be and just have it play bladeid by default, as I think my earlier request to play font wavs for bladeid might have been a bad call, due to the fact that the same functionality can be achieved with pre-font folders if people want it. Blade Detect would remain unchanged.
-
If feasible, make the repeating bladeid scans switch off when the LED FETs power down after the Idle Timeout Delay has passed. Once the saber comes back to life and any accents start again, the scans restart. Though it occurs to me that this might not work on hilts with no accent LEDs. Hmmm…
As always I have no idea how easy, viable, desirable for other people or even possible these things are, but that’s my fourpennth on it.
Prof, I have a hunch I’ve raised more questions than I’ve managed to answer with all this, which wasn’t my intention, but if there is anything else you want me to do that might help with it, just let me know.