fix typos, fix accelerometer
This commit is contained in:
		@@ -138,7 +138,7 @@ function getNoteName(frequency: number): string {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
var notes = [
 | 
			
		||||
let notes = [
 | 
			
		||||
    note(Note.E, BeatFraction.Quarter), note(Note.E, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter),
 | 
			
		||||
    note(Note.G, BeatFraction.Quarter), note(Note.G, BeatFraction.Quarter), note(Note.F, BeatFraction.Quarter),
 | 
			
		||||
    note(Note.E, BeatFraction.Quarter), note(Note.D, BeatFraction.Quarter), note(Note.C, BeatFraction.Quarter),
 | 
			
		||||
@@ -166,7 +166,7 @@ var notes = [
 | 
			
		||||
    note(Note.C, BeatFraction.Eighth), note(Note.C, BeatFraction.Half)
 | 
			
		||||
];
 | 
			
		||||
 | 
			
		||||
for (var t = 0; t < notes.length; t++) {
 | 
			
		||||
for (let t = 0; t < notes.length; t++) {
 | 
			
		||||
    music.playTone(notes[t][0], notes[t][1]);
 | 
			
		||||
    basic.showString(getNoteName(notes[t][0]));
 | 
			
		||||
    music.rest(whole - notes[t][1]);
 | 
			
		||||
 
 | 
			
		||||
@@ -88,13 +88,13 @@
 | 
			
		||||
  "PinPullMode.PullUp|block": "up",
 | 
			
		||||
  "Rotation.Pitch|block": "pitch",
 | 
			
		||||
  "Rotation.Roll|block": "roll",
 | 
			
		||||
  "String.charAt|block": "char from %this|at %pos",
 | 
			
		||||
  "String.compare|block": "compare %this| to %that",
 | 
			
		||||
  "String.concat|block": "join %this|%other",
 | 
			
		||||
  "String.charAt|block": "char from %this=text|at %pos",
 | 
			
		||||
  "String.compare|block": "compare %this=text| to %that",
 | 
			
		||||
  "String.concat|block": "join %this=text|%other",
 | 
			
		||||
  "String.fromCharCode|block": "text from char code %code",
 | 
			
		||||
  "String.isEmpty|block": "%this| is empty",
 | 
			
		||||
  "String.isEmpty|block": "%this=text| is empty",
 | 
			
		||||
  "String.length|block": "length of %VALUE",
 | 
			
		||||
  "String.substr|block": "substring of %this|from %start|of length %length",
 | 
			
		||||
  "String.substr|block": "substring of %this=text|from %start|of length %length",
 | 
			
		||||
  "String|block": "String",
 | 
			
		||||
  "basic.clearScreen|block": "clear screen",
 | 
			
		||||
  "basic.color|block": "%c",
 | 
			
		||||
 
 | 
			
		||||
@@ -170,7 +170,7 @@
 | 
			
		||||
        "yottaTarget": "bbc-microbit-classic-gcc",
 | 
			
		||||
        "yottaCorePackage": "microbit",
 | 
			
		||||
        "githubCorePackage": "calliope-mini/microbit",
 | 
			
		||||
        "gittag": "2.0.0-rc7-calliope-p3",
 | 
			
		||||
        "gittag": "2.0.0-rc7-calliope-p6",
 | 
			
		||||
        "serviceId": "microbit"
 | 
			
		||||
    },    
 | 
			
		||||
    "serial": {
 | 
			
		||||
 
 | 
			
		||||
@@ -223,10 +223,10 @@ namespace pxsim {
 | 
			
		||||
                return DAL.MICROBIT_ACCELEROMETER_EVT_TILT_UP;
 | 
			
		||||
 | 
			
		||||
            if (this.getZ() < (-1000 + DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE))
 | 
			
		||||
                return DAL.MICROBIT_ACCELEROMETER_EVT_FACE_UP;
 | 
			
		||||
                return DAL.MICROBIT_ACCELEROMETER_EVT_FACE_DOWN;
 | 
			
		||||
 | 
			
		||||
            if (this.getZ() > (1000 - DAL.MICROBIT_ACCELEROMETER_TILT_TOLERANCE))
 | 
			
		||||
                return DAL.MICROBIT_ACCELEROMETER_EVT_FACE_DOWN;
 | 
			
		||||
                return DAL.MICROBIT_ACCELEROMETER_EVT_FACE_UP;
 | 
			
		||||
 | 
			
		||||
            return 0;
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user