Reading/setting non-contact registers while scanning?

Hello,

I have a Morph connected to a Teensy microcontroller over the serial adapter and a hardware serial port on the Teensy side. I receive all the contact data smoothly through scanning.

However I’d like to get the battery information as well as play a bit with the LEDs. Can I achieve this while the scan is active or should I interrupt it to access the matching registers?

Any code would be highly appreciated.

Thank you in advance.

Isn’t there anyone on this forum? Duh.

Mainly lip service, but you’ll occasionally get some good information from devs or users depending if they have applicable experience.

@amundsen sorry for the delay. We’re looking into this. Are you using the Arduino API?

@Matt_from_Sensel indeed I am using the Arduino API.

Got it! We haven’t implemented these functions on Arduino, but you can write the code to get and set this information if you feel up to it.

You can see the registers for getting and setting information on the public api here: https://github.com/sensel/sensel-api/blob/master/sensel-lib/src/sensel_register_map.h.

SENSEL_REG_BATTERY_PERCENTAGE is a one byte register read. And Setting the LEDs can be found in the senselSetLEDBrightness function in https://github.com/sensel/sensel-api/blob/master/sensel-lib/src/sensel.c

Hope this helps!

Thank you. I understand that using the registers are mandatory but my question was more specifically about the possibility to achieve this while the scan is active.

@amundsen yes, this should be possible!

1 Like