Can I save serial to SD for review?

Is there a define that will allow me to save the serial log onto the SD card for review? I have a removable chassis and would like to test some BLADEID ideas, but the chassis can not be connected to USB while in the saber.

If not, and I have experimental code, where would that be best placed. Which file, and about what position.

I am using a modified fet button prop and Proffie master.

Thanks

Unfortunately no such define exists yet.
Experimental code can go anywhere really. Usually you have to modify something, and if you do it would need to go where the code that you are modifying is. Sometimes the new code is just a new class, in which case you probably just want to put it in your config file, usually the CONFIG_STYLE section is best for this, but it depends a bit on what you’re doing.

If you’re doing stuff with blade id, maybe it should go in blades/blade_id.h ?

blade_id_logger.h (1.8 KB)

So I made this and got it to compile using fetts button prop. When I went to modify my config file and switched on bladeid, serial was giving me a bladeid of 0 with the chassis out, so I think this is where I bail out. I did not see any blade.txt file, so it is not working and I don’t know if the saber wired to be capable of bladeid so I am giving up here, but I thought I would upload this if anyone wants to go down this path and maybe this will possibly give them a head start. If you do get it working please let me know, as I have other sabers with working bladeIDs that I can test it out on.

Thanks

Blade ID does a lot more than analogRead().
If you want values that are useful in ProffieOS, you’re going to need to use the classes defined in blade_id.h to read the value.

Also, you probably want LSFS::OpenForWrite() rather than LSFS::Open(), and you should also use LOCK_SD() to make sure the audio interrupt doesn’t mess things up while you are writing.

You could try adding
#define SPEAK_BLADE_ID

This will announce the blade id when it is detected so you will know which ID is active. One word of caution–I tried to use it in a saber that wasn’t wired for blade detect and it started spamming blade id’s–I had to turn it off with the kill switch and disable the define–but it works great on all my sabers wired for blade-detect.

1 Like