Assignment of new sensor command numbers?

Hello,

I am curious how you are managing the assignment of new sensor command numbers?

I have three new parts that I am working with that are currently not supported by the Grove Pi. Each of these will require that I write the code in the firmware to work with them. I’ve looked around, and have not seen a common header that is being maintained with these numbers within the firmware, and I was wondering how I might want to select or use numbers for these new sensors?

Is there a recommended range that I ought to use?

Hey,
There are no strict rules as such for the assignment of the new sensor command numbers but these are the pointers that we usually follow:

  • Do not use a number which is already being used
  • The number should be between 0-255
  • If you have a sensor which needs a lot of functions to be implemented on the firmware, then it would be better to use sequential numbers for it, like the 4 digit display uses numbers from 70 to 79.
  • If you just want to implement 1 function, then it might be better to just continue from 13 or 22
  • -Karan