As this is an algorithm, I don't think it can be copyrighted anyways as you can't copyright logic?
You can if you outline how the logic is applied to an apparatus. Example "Breathing status LED indicator" https://patents.google.com/patent/US6658577B2/en
You can if you outline how the logic is applied to an apparatus. Example "Breathing status LED indicator" https://patents.google.com/patent/US6658577B2/en