Controlling LEDs from Arduino API


#1

How do you control the 24 LEDs from the Arduino API? I don’t see any API calls or register names that look like they are useful to that end. I assume there is a register you write to, is it documented in the API files?


#2

Hello, thank you for contacting us. We have not added this feature to the Arduino API yet. We do have this feature in the open-source API for c, python and C#. If you would like to bring over this feature, you can find the source starting here https://github.com/sensel/sensel-api/blob/1139c84b35837dce94f49ef926ca5e9d55693fd7/sensel-lib/src/sensel.c#L293.


#3

I’m trying to port the LED codes over to my copy of the Arduino API, but I don’t understand the senselWriteReg function in file sensel.ino . Lines 80 and 81 write the same byte twice. And there seems to be no code to write 16-bit values to two-byte registers. Why is that?


#4

Hello, the same byte is sent twice in the Arduino code because the second byte is the checksum, which is useful when writing more than one byte as a check on the data being sent. Currently, the Arduino code is only set up to send single bytes but still needs to comply with the protocol. You can see the full write method in our open source API here https://github.com/sensel/sensel-api/blob/1139c84b35837dce94f49ef926ca5e9d55693fd7/sensel-lib/src/sensel_register.c#L102.

Additionally, the LED commands do not use write register, they use the variable size write register, which can be found here in the open source api: https://github.com/sensel/sensel-api/blob/1139c84b35837dce94f49ef926ca5e9d55693fd7/sensel-lib/src/sensel_register.c#L199

We will be adding more functionality and documentation to the Arduino API in the future, but do not have a release date at this time.


URGENT: Q about Arduino API