let Sin: number[] = []
let geduld = 0
let farbe = 0
let Index = 0
input.onButtonPressed(Button.A, () => {
farbe += 1
if (farbe > 4) {
farbe = 1
}
})
farbe = 1
geduld = 40
Sin = [0, 0, 1, 3, 5, 8, 11, 15, 19, 23, 28, 34, 39, 45, 51, 58, 64, 70, 76, 83, 88, 94, 100, 105, 109, 113, 117, 120, 123, 125, 127, 128, 128]
basic.forever(() => {
while (farbe == 1) {
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
Sin[Index],
0,
0,
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
Sin[31 - Index],
0,
0,
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
}
while (farbe == 2) {
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
0,
Sin[Index],
0,
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
0,
Sin[31 - Index],
0,
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
}
while (farbe == 3) {
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
0,
0,
Sin[Index],
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
0,
0,
Sin[31 - Index],
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
}
while (farbe > 3) {
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
Sin[Index],
Sin[Index],
Sin[Index],
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
for (let Index = 0; Index <= 31; Index++) {
basic.setLedColor(basic.rgbw(
Sin[31 - Index],
Sin[31 - Index],
Sin[31 - Index],
0
))
Index += 1
basic.pause(geduld)
}
Index = 0
}
})
Comments
Please log in or sign up to comment.