light the way activities

This commit is contained in:
Peli de Halleux
2018-01-05 19:14:55 -08:00
parent 94c4e508fe
commit 931987468a
9 changed files with 78 additions and 19 deletions

View File

@ -4,7 +4,7 @@
* [Download Curriculum Materials](https://education.lego.com/en-us/downloads/mindstorms-ev3)
## Activites
## Three Point Turn
```codecard
[
@ -23,7 +23,13 @@
"description": "Activity 3",
"url":"/coding/three-point-turn-3",
"cardType": "example"
}, {
}]
```
## Reversing the robot
```codecard
[{
"name": "Reversing the robot",
"description": "Activity 1",
"url":"/coding/reversing-the-robot-1",
@ -38,6 +44,27 @@
"description": "Activity 3",
"url":"/coding/reversing-the-robot-3",
"cardType": "example"
}]
```
## Light the way
```codecard
[{
"name": "Light the way",
"description": "Activity 1",
"url":"/coding/light-the-way-1",
"cardType": "example"
}, {
"name": "Light the way",
"description": "Activity 2",
"url":"/coding/light-the-way-2",
"cardType": "example"
}, {
"name": "Light the way",
"description": "Activity 3",
"url":"/coding/light-the-way-3",
"cardType": "example"
}
]
```

View File

@ -0,0 +1,9 @@
# Light the way Activity 1
```blocks
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () {
brick.showImage(images.objectsLightOn)
loops.pause(5000)
brick.clearScreen()
})
```

View File

@ -0,0 +1,10 @@
# Light the way Activity 2
```blocks
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Bright, function () {
brick.clearScreen()
})
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () {
brick.showImage(images.objectsLightOn)
})
```

View File

@ -0,0 +1,13 @@
# Light the way Activity 3
```blocks
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Bright, function () {
brick.clearScreen()
})
sensors.color3.onLightChanged(LightIntensityMode.Ambient, LightCondition.Dark, function () {
brick.showImage(images.objectsLightOn)
})
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
brick.showImage(images.objectsLightOn);
})
```