diff --git a/libs/calliope-test/calliope.ts b/libs/calliope-test/calliope.ts index 98a4d432..44f2091d 100644 --- a/libs/calliope-test/calliope.ts +++ b/libs/calliope-test/calliope.ts @@ -1,4 +1,4 @@ -basic.showString("RGB") +/*basic.showString("RGB") basic.setLedColor(Colors.Blue) basic.pause(500) basic.setLedColor(Colors.Red) @@ -39,4 +39,16 @@ input.onGesture(Gesture.ThreeG, () => { input.onGesture(Gesture.SixG, () => { basic.showString("6") }) - +*/ +input.onPinPressed(TouchPin.P0, () => { + basic.showNumber(0) +}) +input.onPinPressed(TouchPin.P1, () => { + basic.showNumber(1) +}) +input.onPinPressed(TouchPin.P2, () => { + basic.showNumber(2) +}) +input.onPinPressed(TouchPin.P3, () => { + basic.showNumber(3) +}) diff --git a/libs/core/dal.d.ts b/libs/core/dal.d.ts index 581f0bfa..06c8867c 100644 --- a/libs/core/dal.d.ts +++ b/libs/core/dal.d.ts @@ -145,13 +145,14 @@ declare const enum DAL { MICROBIT_ID_RADIO_DATA_READY = 30, MICROBIT_ID_MULTIBUTTON_ATTACH = 31, MICROBIT_ID_SERIAL = 32, - CALLIOPE_ID_IO_P0 = 33, + CALLIOPE_ID_IO_P3 = 33, CALLIOPE_ID_IO_P7 = 34, CALLIOPE_ID_IO_P8 = 35, CALLIOPE_ID_IO_P9 = 36, CALLIOPE_ID_IO_P13 = 37, CALLIOPE_ID_IO_P14 = 38, CALLIOPE_ID_IO_P15 = 39, + CALLIOPE_ID_IO_P22 = 40, MICROBIT_ID_MESSAGE_BUS_LISTENER = 1021, MICROBIT_ID_NOTIFY_ONE = 1022, MICROBIT_ID_NOTIFY = 1023, diff --git a/libs/core/enums.d.ts b/libs/core/enums.d.ts index 48f7509b..ff340694 100644 --- a/libs/core/enums.d.ts +++ b/libs/core/enums.d.ts @@ -37,6 +37,7 @@ declare namespace basic { P0 = 7, // MICROBIT_ID_IO_P0 P1 = 8, // MICROBIT_ID_IO_P1 P2 = 9, // MICROBIT_ID_IO_P2 + P3 = 33, // CALLIOPE_ID_IO_P3 } diff --git a/libs/core/input.cpp b/libs/core/input.cpp index 90c59f61..c8c0b181 100644 --- a/libs/core/input.cpp +++ b/libs/core/input.cpp @@ -29,6 +29,7 @@ enum class TouchPin { P0 = MICROBIT_ID_IO_P0, P1 = MICROBIT_ID_IO_P1, P2 = MICROBIT_ID_IO_P2, + P3 = CALLIOPE_ID_IO_P3 }; enum class AcceleratorRange { diff --git a/libs/core/pins.cpp b/libs/core/pins.cpp index c41809c0..47e30ba4 100644 --- a/libs/core/pins.cpp +++ b/libs/core/pins.cpp @@ -66,6 +66,14 @@ MicroBitPin *getPin(int id) { //case MICROBIT_ID_IO_P16: return &uBit.io.P16; case MICROBIT_ID_IO_P19: return &uBit.io.P19; case MICROBIT_ID_IO_P20: return &uBit.io.P20; + case CALLIOPE_ID_IO_P3: return &uBit.io.CAL_P3; + case CALLIOPE_ID_IO_P7: return &uBit.io.CAL_P7; + case CALLIOPE_ID_IO_P8: return &uBit.io.CAL_P8; + case CALLIOPE_ID_IO_P9: return &uBit.io.CAL_P9; + case CALLIOPE_ID_IO_P13: return &uBit.io.CAL_P13; + case CALLIOPE_ID_IO_P14: return &uBit.io.CAL_P14; + case CALLIOPE_ID_IO_P15: return &uBit.io.CAL_P15; + case CALLIOPE_ID_IO_P22: return &uBit.io.CAL_P22; default: return NULL; } } diff --git a/pxtarget.json b/pxtarget.json index 5d383db5..5c0a3001 100644 --- a/pxtarget.json +++ b/pxtarget.json @@ -202,7 +202,7 @@ "yottaTarget": "bbc-microbit-classic-gcc", "yottaCorePackage": "pxt-calliope-core", "githubCorePackage": "microsoft/pxt-calliope-core", - "gittag": "v0.5.11", + "gittag": "v0.5.12", "serviceId": "calliope" }, "serial": {