Skip to content

Commit

Permalink
update touch mode handling to support resistive and capacitative mode…
Browse files Browse the repository at this point in the history
…s based on input data
  • Loading branch information
Amerlander committed Mar 3, 2025
1 parent 26cf2b2 commit eda9ce8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libs/scratch/MbitMoreDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,11 @@ void MbitMoreDevice::onCommandReceived(uint8_t *data, size_t length) {
&MbitMoreDevice::onButtonChanged,
MESSAGE_BUS_LISTENER_QUEUE_IF_BUSY);
#if MICROBIT_CODAL
uBit.io.pin[pinIndex].isTouched(codal::TouchMode::Capacitative);
if(data[3] == 1) {
uBit.io.pin[pinIndex].isTouched(codal::TouchMode::Resistive);
} else {
uBit.io.pin[pinIndex].isTouched(codal::TouchMode::Capacitative);
}
#else // NOT MICROBIT_CODAL
uBit.io.pin[pinIndex].isTouched();
#endif // NOT MICROBIT_CODAL
Expand Down

0 comments on commit eda9ce8

Please sign in to comment.