fix touch pins, add test for buttons and pins, update dependency
This commit is contained in:
		@@ -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)
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										3
									
								
								libs/core/dal.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								libs/core/dal.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -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,
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								libs/core/enums.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								libs/core/enums.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -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
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user