Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Por DAVID LEONARDO CASTRO MUÑOZ

Ejercicio Bicicleta

input.onGesture(Gesture.LogoUp, function () {
basic.showLeds(`
. . # . .
. # # # .
# # # # #
. . . . .
. . . . .
`)
basic.showLeds(`
. . . . .
. . . . .
. . . . .
. . # . .
. # # # .
`)
})
basic.forever(function () {
if (input.buttonIsPressed(Button.A)) {
basic.showLeds(`
. . # . .
. # . . .
# # # # #
. # . . .
. . # . .
`)
}
basic.clearScreen()
if (input.buttonIsPressed(Button.B)) {
basic.showLeds(`
. . # . .
. . . # .
# # # # #
. . . # .
. . # . .
`)
}
basic.clearScreen()
if (input.buttonIsPressed(Button.AB)) {
basic.showIcon(IconNames.Target)
}
})
ACTIVIDAD 1 BOTONES INTENTO (PROPIO)

basic.forever(function () {
basic.showNumber(0)
if (input.buttonIsPressed(Button.AB)) {
basic.showNumber(2)
}
while (input.buttonIsPressed(Button.A)) {
basic.showNumber(1)
}
basic.clearScreen()
while (input.buttonIsPressed(Button.B)) {
basic.showNumber(1)
}
basic.clearScreen()
})

ACTIVIDAD 2 NIVELADOR (PROPIO)


basic.forever(function () {
while (input.isGesture(Gesture.ScreenUp)) {
basic.showIcon(IconNames.Happy)
}
while (input.isGesture(Gesture.TiltLeft)) {
basic.showLeds(`
. . # . .
. . . # .
# # # # #
. . . # .
. . # . .
`)
}
while (input.isGesture(Gesture.TiltRight)) {
basic.showLeds(`
. . # . .
. # . . .
# # # # #
. # . . .
. . # . .
`)
}
})

ACTIVIDAD 1 BOTONES CORREGIDO – GUIA

input.onButtonPressed(Button.A, function () {
basic.showNumber(1)
})
input.onButtonPressed(Button.AB, function () {
basic.showNumber(2)
})
input.onButtonPressed(Button.B, function () {
basic.showNumber(1)
})
basic.showNumber(0)
ACTIVIDAD 2 NIVELADOR CORREGIDO – GUIA

basic.forever(function () {
while (input.acceleration(Dimension.X) < 5 && input
.acceleration(Dimension.X) >= 0) {
basic.showLeds(`
# . . . #
# # . . #
# . # . #
# . . # #
# . . . #
`)
}
if (input.acceleration(Dimension.X) > 5 && input.ac
celeration(Dimension.X) < 500) {
basic.showLeds(`
. . . . #
. . . # #
. . # # #
. . . # #
. . . . #
`)
if (input.acceleration(Dimension.X) > 500 && in
put.acceleration(Dimension.X) < 1023) {
basic.showLeds(`
. . . # #
. . # # #
. # # # #
. . # # #
. . . # #
`)
}
}
if (input.acceleration(Dimension.X) < -
5 && input.acceleration(Dimension.X) > -500) {
basic.showLeds(`
# . . . .
# # . . .
# # # . .
# # . . .
# . . . .
`)
if (input.acceleration(Dimension.X) < -
500 && input.acceleration(Dimension.X) > -1023) {
basic.showLeds(`
# # . . .
# # # . .
# # # # .
# # # . .
# # . . .
`)
}
}
})

You might also like