Chysn / O_C-HemisphereSuite

Hemisphere Suite is alternate-alternate firmware for Ornament and Crime, featuring a dual-applet framework with dozens of different modular functions.
324 stars 153 forks source link

Calculate Sum doesn't return negative values #102

Closed jroo closed 2 years ago

jroo commented 3 years ago

Line 25 of the code below has a constraint on the output of SUM that is between 0 and HEMISPHERE_MAX_CV that prevents negative voltage from being returned while the the others have no such constraint. I'm happy to put in a pull request to remove this constraint by possibly changing 0 to HEMIPSHERE_MIN_CV, assuming it exists but I first wanted to check to see if this was actually a bug or if the constraint was intentional. I have a need to output less than 0V but don't want to damage my O_C. Thanks!

https://github.com/Chysn/O_C-HemisphereSuite/blob/a44e89a6f7228c6c056eb55dd78eab0afc00bf23/software/o_c_REV/HEM_Calculate.ino#L23-L27

Chysn commented 3 years ago

Yeah, I think that's a good idea. At this point, I can only guess about my original thought process. My guess would be that I figured because DIFF can't go negative, SUM shouldn't go negative either. I have no objection to removing the constraint, and I'll push that update. Instead, I'll move the constraint to the output and make it full-range (-3V to +5V)

jroo commented 3 years ago

Thank you!