Merge branch 'rev03-changes'
# Conflicts: # libs/core/motors.cpp # libs/core/music.cpp # package.json
This commit is contained in:
		
							
								
								
									
										3
									
								
								libs/core/dal.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								libs/core/dal.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -153,6 +153,9 @@ declare const enum DAL {
 | 
				
			|||||||
    CALLIOPE_ID_IO_P14 = 38,
 | 
					    CALLIOPE_ID_IO_P14 = 38,
 | 
				
			||||||
    CALLIOPE_ID_IO_P15 = 39,
 | 
					    CALLIOPE_ID_IO_P15 = 39,
 | 
				
			||||||
    CALLIOPE_ID_IO_P22 = 40,
 | 
					    CALLIOPE_ID_IO_P22 = 40,
 | 
				
			||||||
 | 
					    CALLIOPE_ID_IO_P28 = 41,
 | 
				
			||||||
 | 
					    CALLIOPE_ID_IO_P29 = 42,
 | 
				
			||||||
 | 
					    CALLIOPE_ID_IO_P30 = 43,
 | 
				
			||||||
    MICROBIT_ID_MESSAGE_BUS_LISTENER = 1021,
 | 
					    MICROBIT_ID_MESSAGE_BUS_LISTENER = 1021,
 | 
				
			||||||
    MICROBIT_ID_NOTIFY_ONE = 1022,
 | 
					    MICROBIT_ID_NOTIFY_ONE = 1022,
 | 
				
			||||||
    MICROBIT_ID_NOTIFY = 1023,
 | 
					    MICROBIT_ID_NOTIFY = 1023,
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										7
									
								
								libs/core/enums.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										7
									
								
								libs/core/enums.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -37,7 +37,7 @@ declare namespace basic {
 | 
				
			|||||||
    P0 = 7,  // MICROBIT_ID_IO_P0
 | 
					    P0 = 7,  // MICROBIT_ID_IO_P0
 | 
				
			||||||
    P1 = 8,  // MICROBIT_ID_IO_P1
 | 
					    P1 = 8,  // MICROBIT_ID_IO_P1
 | 
				
			||||||
    P2 = 9,  // MICROBIT_ID_IO_P2
 | 
					    P2 = 9,  // MICROBIT_ID_IO_P2
 | 
				
			||||||
    P3 = 33,  // CALLIOPE_ID_IO_P3
 | 
					    P3 = 40,  // CALLIOPE_ID_IO_P22
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -282,6 +282,9 @@ declare namespace motors {
 | 
				
			|||||||
    //P16 = MICROBIT_ID_IO_P16,
 | 
					    //P16 = MICROBIT_ID_IO_P16,
 | 
				
			||||||
    P19 = 24,  // MICROBIT_ID_IO_P19
 | 
					    P19 = 24,  // MICROBIT_ID_IO_P19
 | 
				
			||||||
    P20 = 25,  // MICROBIT_ID_IO_P20
 | 
					    P20 = 25,  // MICROBIT_ID_IO_P20
 | 
				
			||||||
 | 
					    P28 = 41,  // CALLIOPE_ID_IO_P28
 | 
				
			||||||
 | 
					    P29 = 42,  // CALLIOPE_ID_IO_P29
 | 
				
			||||||
 | 
					    P30 = 43,  // CALLIOPE_ID_IO_P30
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -292,6 +295,8 @@ declare namespace motors {
 | 
				
			|||||||
    P3 = 10,  // MICROBIT_ID_IO_P3
 | 
					    P3 = 10,  // MICROBIT_ID_IO_P3
 | 
				
			||||||
    P4 = 11,  // MICROBIT_ID_IO_P4
 | 
					    P4 = 11,  // MICROBIT_ID_IO_P4
 | 
				
			||||||
    P10 = 17,  // MICROBIT_ID_IO_P10
 | 
					    P10 = 17,  // MICROBIT_ID_IO_P10
 | 
				
			||||||
 | 
					    P29 = 42,  // CALLIOPE_ID_IO_P29
 | 
				
			||||||
 | 
					    P30 = 43,  // CALLIOPE_ID_IO_P30
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,7 +29,7 @@ enum class TouchPin {
 | 
				
			|||||||
    P0 = MICROBIT_ID_IO_P0,
 | 
					    P0 = MICROBIT_ID_IO_P0,
 | 
				
			||||||
    P1 = MICROBIT_ID_IO_P1,
 | 
					    P1 = MICROBIT_ID_IO_P1,
 | 
				
			||||||
    P2 = MICROBIT_ID_IO_P2,
 | 
					    P2 = MICROBIT_ID_IO_P2,
 | 
				
			||||||
    P3 = CALLIOPE_ID_IO_P3
 | 
					    P3 = CALLIOPE_ID_IO_P22
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum class AcceleratorRange {
 | 
					enum class AcceleratorRange {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,11 +8,11 @@ namespace music {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    //% help=music/play-tone weight=90
 | 
					    //% help=music/play-tone weight=90
 | 
				
			||||||
    //% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
 | 
					    //% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
 | 
				
			||||||
    //% parts="speaker" async
 | 
					    //% parts="speaker"
 | 
				
			||||||
    void playTone(int frequency, int ms) {
 | 
					    void playTone(int freqency, int ms) {
 | 
				
			||||||
        uBit.soundmotor.Sound_On(frequency);
 | 
					        uBit.soundmotor.soundOn(freqency);
 | 
				
			||||||
        if(ms > 0) uBit.sleep(ms);
 | 
					        if(ms > 0) uBit.sleep(ms);
 | 
				
			||||||
        uBit.soundmotor.Sound_Off();
 | 
					        uBit.soundmotor.soundOff();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -167,7 +167,7 @@ namespace music {
 | 
				
			|||||||
        let beat = 60000 / beatsPerMinute;
 | 
					        let beat = 60000 / beatsPerMinute;
 | 
				
			||||||
        if (fraction == BeatFraction.Whole) return beat;
 | 
					        if (fraction == BeatFraction.Whole) return beat;
 | 
				
			||||||
        else if (fraction == BeatFraction.Half) return beat / 2;
 | 
					        else if (fraction == BeatFraction.Half) return beat / 2;
 | 
				
			||||||
        else if (fraction == BeatFraction.Quarter) return beat / 4
 | 
					        else if (fraction == BeatFraction.Quarter) return beat / 4;
 | 
				
			||||||
        else if (fraction == BeatFraction.Eighth) return beat / 8;
 | 
					        else if (fraction == BeatFraction.Eighth) return beat / 8;
 | 
				
			||||||
        else return beat / 16;
 | 
					        else return beat / 16;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,6 +20,9 @@ enum class DigitalPin {
 | 
				
			|||||||
    //P16 = MICROBIT_ID_IO_P16,
 | 
					    //P16 = MICROBIT_ID_IO_P16,
 | 
				
			||||||
    P19 = MICROBIT_ID_IO_P19,
 | 
					    P19 = MICROBIT_ID_IO_P19,
 | 
				
			||||||
    P20 = MICROBIT_ID_IO_P20,
 | 
					    P20 = MICROBIT_ID_IO_P20,
 | 
				
			||||||
 | 
					    P28 = CALLIOPE_ID_IO_P28,
 | 
				
			||||||
 | 
					    P29 = CALLIOPE_ID_IO_P29,
 | 
				
			||||||
 | 
					    P30 = CALLIOPE_ID_IO_P30
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum class AnalogPin {
 | 
					enum class AnalogPin {
 | 
				
			||||||
@@ -29,6 +32,8 @@ enum class AnalogPin {
 | 
				
			|||||||
    P3 = MICROBIT_ID_IO_P3,
 | 
					    P3 = MICROBIT_ID_IO_P3,
 | 
				
			||||||
    P4 = MICROBIT_ID_IO_P4,
 | 
					    P4 = MICROBIT_ID_IO_P4,
 | 
				
			||||||
    P10 = MICROBIT_ID_IO_P10,
 | 
					    P10 = MICROBIT_ID_IO_P10,
 | 
				
			||||||
 | 
					    P29 = CALLIOPE_ID_IO_P29,
 | 
				
			||||||
 | 
					    P30 = CALLIOPE_ID_IO_P30
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum class PulseValue {
 | 
					enum class PulseValue {
 | 
				
			||||||
@@ -74,6 +79,9 @@ MicroBitPin *getPin(int id) {
 | 
				
			|||||||
        case CALLIOPE_ID_IO_P14: return &uBit.io.CAL_P14;
 | 
					        case CALLIOPE_ID_IO_P14: return &uBit.io.CAL_P14;
 | 
				
			||||||
        case CALLIOPE_ID_IO_P15: return &uBit.io.CAL_P15;
 | 
					        case CALLIOPE_ID_IO_P15: return &uBit.io.CAL_P15;
 | 
				
			||||||
        case CALLIOPE_ID_IO_P22: return &uBit.io.CAL_P22;
 | 
					        case CALLIOPE_ID_IO_P22: return &uBit.io.CAL_P22;
 | 
				
			||||||
 | 
					        case CALLIOPE_ID_IO_P28: return &uBit.io.CAL_P28;
 | 
				
			||||||
 | 
					        case CALLIOPE_ID_IO_P29: return &uBit.io.CAL_P29;
 | 
				
			||||||
 | 
					        case CALLIOPE_ID_IO_P30: return &uBit.io.CAL_P30;
 | 
				
			||||||
        default: return NULL;
 | 
					        default: return NULL;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										12
									
								
								libs/core/shims.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								libs/core/shims.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -559,6 +559,18 @@ declare namespace music {
 | 
				
			|||||||
    //% parts="speaker" shim=music::ringTone
 | 
					    //% parts="speaker" shim=music::ringTone
 | 
				
			||||||
    function ringTone(frequency: number): void;
 | 
					    function ringTone(frequency: number): void;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					declare namespace music {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Plays a tone through ``speaker`` for the given duration.
 | 
				
			||||||
 | 
					     * @param frequency pitch of the tone to play in Hertz (Hz)
 | 
				
			||||||
 | 
					     * @param ms tone duration in milliseconds (ms)
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    //% help=music/play-tone weight=90
 | 
				
			||||||
 | 
					    //% blockId=device_play_note block="play|tone %note=device_note|for %duration=device_beat" icon="\uf025" blockGap=8
 | 
				
			||||||
 | 
					    //% parts="speaker" shim=music::playTone
 | 
				
			||||||
 | 
					    function playTone(freqency: number, ms: number): void;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
declare namespace pins {
 | 
					declare namespace pins {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user