M2TKLIB - A User-Interface-Toolkit for the Arduino Hardware

Hi

Is there a signed flavour of uint8_t?

This should be "int8_t".

Also, what is the purpose of calling "m2.checkKey();" multiple times within the main loop?

A call to "checkKey()" polls the values of the rotary encoder and the other keys. There is no interrupt based check of the rotary encoder, instead M2tklib requires as much calls to "checkKey()" as possible.

I'm also confused about how i pass a value back through the callback procedure. I was looking at the example code and i'm unsure how i would use that. Say for example i wanted to do a Serial.print(); of the current S8NUM value for el_u1.

You need to use global variables to pass values to a callback procedure (as you did correctly in the second code example).

This will do the print for each changed value:

uint8_t global_value = 0;
 
uint8_t u8_cb(m2_rom_void_p element, uint8_t msg, uint8_t val)
{
  if ( msg == M2_U8_MSG_SET_VALUE )
  { 
    global_value = val;
    Serial.print(global_value);
  }
  return global_value;
}

Oliver