I can't find an explanation for this data type in the Arduino reference - so I'm wondering two things:
What exactly is the 'short' data type and 2) Is there a better/more efficient way of writing it in Arduino?
The main reason I'm asking is that I want to try and change the data type for some things these functions are referencing - to try an optimise one part of my code, but don't want to do it before I understand exactly what type of data these functions are looking for now.
Is there a better/more efficient way of writing it in Arduino?
Not sure if it's better or more efficient but I have a C++ DAC library that
supports the TLV5618 and TLV5620 at Loading...
Scroll down to the library links in the sidebar.
Groove - the function is being passed an 'int' - so I might change that to 'short' rather than the other way round.
JCL - this is part of JP's MIDI2CV code - which you're familiar with! Like I said, it's working fine (along with Lin to EXP conversion and 2 x 4 way multiplexing now) - just trying to get the code running a bit faster.
I have not looked at JP's code but when doing the code for my numerically controlled
oscillator (NCO) I did notice a major speed improvement when I changed the digitalWrite statements to assignment statements that directly set the bits in the ports. I am thinking of going back to my DAC library and updating it.