diff --git a/docs/projects.md b/docs/projects.md index 5f021827..c28634e0 100644 --- a/docs/projects.md +++ b/docs/projects.md @@ -2,32 +2,44 @@ ![](/static/mb/projects/all10.png) -![](/static/mb/projects/a1-display.png) - ## [Flashing Heart](/projects/flashing-heart) -![](/static/mb/projects/a2-buttons.png) +![](/static/mb/projects/a1-display.png) ## [Smiley Buttons](/projects/smiley-buttons) -![](/static/mb/projects/a3-pins.png) +![](/static/mb/projects/a2-buttons.png) ## [Love Meter](/projects/love-meter) -![](/static/mb/projects/a4-motion.png) +![](/static/mb/projects/a3-pins.png) ## [Rock Paper Scissors](/projects/rock-paper-scissors) +![](/static/mb/projects/a4-motion.png) + +## [Compass](/projects/compass) + ![](/static/mb/projects/a5-compass.png) +## Music + ![](/static/mb/projects/a6-music.png) +## Conductive + ![](/static/mb/projects/a7-conductive.png) +## Network + ![](/static/mb/projects/a8-network.png) +## Radio + ![](/static/mb/projects/a9-radio.png) +## Watch + ![](/static/mb/projects/a10-watch.png) diff --git a/docs/projects/compass.md b/docs/projects/compass.md new file mode 100644 index 00000000..381b79c0 --- /dev/null +++ b/docs/projects/compass.md @@ -0,0 +1,83 @@ +![](/static/mb/projects/a5-compass.png) + +Use the compass to determine which direction you are heading. + +## Step 1 + +Continuously sample the compass heading and store in the variable `degrees`: + +```blocks +let degrees = 0; +basic.forever(() => { + degrees = input.compassHeading(); +}); +``` + +## Step 2 + +If the degrees is less than 45, we are heading North: + +```blocks +let degrees = 0; +basic.forever(() => { + degrees = input.compassHeading(); + if (degrees <= 45) { + basic.showString("N"); + } else if (false) { } else { } +}); +``` + +### Step 3 + +Otherwise, if the degrees is less than 135, we are heading East: + +```blocks +let degrees = 0; +basic.forever(() => { + degrees = input.compassHeading(); + if (degrees <= 45) { + basic.showString("N"); + } else if (degrees <= 135) { + basic.showString("E"); + } else { } +}); +``` + +### Step 4 + +Otherwise, if the degrees is less than 225, we are heading East: + +```blocks +let degrees = 0; +basic.forever(() => { + degrees = input.compassHeading(); + if (degrees <= 45) { + basic.showString("N"); + } else if (degrees <= 135) { + basic.showString("E"); + } else if (degrees <= 225) { + basic.showString("S"); + } else { + } +}); +``` + +### Step 5 + +Otherwise, we are heading west. + +```blocks +let degrees = 0; +basic.forever(() => { + degrees = input.compassHeading(); + if (degrees <= 45) { + basic.showString("N"); + } else if (degrees <= 135) { + basic.showString("E"); + } else if (degrees <= 225) { + basic.showString("S"); + } else { + basic.showString("W"); + } +}); +``` \ No newline at end of file diff --git a/docs/projects/rock-paper-scissors.md b/docs/projects/rock-paper-scissors.md index 2fe149e9..15ae7f51 100644 --- a/docs/projects/rock-paper-scissors.md +++ b/docs/projects/rock-paper-scissors.md @@ -1,5 +1,7 @@ # rock paper scissors +![](/static/mb/projects/a4-motion.png) + ### ~avatar avatar ```sim diff --git a/docs/static/mb/projects/all10.png b/docs/static/mb/projects/all10.png index c1af1d0e..e2aa6663 100644 Binary files a/docs/static/mb/projects/all10.png and b/docs/static/mb/projects/all10.png differ