You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This means that in order to iterate over all the buttons to find out which one was pressed, a cast to the touchButtons type must be used:
for (int i = 0; i <= 4; ++i) {
if (carrier.Buttons.onTouchDown((touchButtons)i)) {
Serial.print("Button pressed: ");
Serial.println(i);
}
}
Considering this type is not documented anywhere and probably not strictly necessary, can't we just allow plan ints as arguments and get rid of those TOUCHx constants?
The text was updated successfully, but these errors were encountered:
As of now, touch buttons are identified using an enum class:
Arduino_MKRIoTCarrier/src/Arduino_MKRIoTCarrier_Qtouch.h
Lines 29 to 35 in 4a894ad
This means that in order to iterate over all the buttons to find out which one was pressed, a cast to the
touchButtons
type must be used:Considering this type is not documented anywhere and probably not strictly necessary, can't we just allow plan ints as arguments and get rid of those
TOUCHx
constants?The text was updated successfully, but these errors were encountered: