update wifi lesson

This commit is contained in:
Michael Elliot Braun 2016-03-31 16:39:32 -07:00
parent b210e505a2
commit e6a1728f6e

View File

@ -9,12 +9,12 @@ Complete the following exercise. Your code should look like this:
```blocks
basic.showString("Check Wifi", 150)
basic.forever(() => {
let xAccel = math.abs(input.acceleration("x"))
let yAccel = math.abs(input.acceleration("y"))
let zAccel = math.abs(input.acceleration("z"))
let xAccel = Math.abs(input.acceleration(Dimension.X))
let yAccel = Math.abs(input.acceleration(Dimension.Y))
let zAccel = Math.abs(input.acceleration(Dimension.Z))
let sum = xAccel + yAccel + zAccel
if (sum < 1400) {
basic.showleds(`
basic.showLeds(`
. . . . .
. . . . .
. . # . .
@ -22,16 +22,15 @@ basic.forever(() => {
# # # . .
`)
} else if (sum >= 1400 && sum < 1680) {
basic.showleds(`
basic.showLeds(`
. . . . .
. . . # .
. . # # .
. # # # .
# # # # .
`)
}
else if (sum >= 1680) {
basic.showleds(`
} else if (sum >= 1680) {
basic.showLeds(`
. . . . .
. . . . .
. . . . .
@ -40,6 +39,7 @@ basic.forever(() => {
`)
}
})
```
**Challenge 1**
@ -53,7 +53,7 @@ Edit this line: if sum is greater than 1400 then just click on the `1400` and ba
```blocks
basic.showString("Check Wifi", 150)
basic.forever(() => {
let xAccel1 = math.abs(input.acceleration("x"))
let xAccel1 = Math.abs(input.acceleration(Dimension.X))
let yAccel1 = math.abs(input.acceleration("y"))
let zAccel1 = math.abs(input.acceleration("z"))
let sum1 = xAccel1 + yAccel1 + zAccel1