Skip to content

Instantly share code, notes, and snippets.

@fab3r
Created April 29, 2017 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fab3r/e38de86336202358f7005b67745a48a9 to your computer and use it in GitHub Desktop.
Save fab3r/e38de86336202358f7005b67745a48a9 to your computer and use it in GitHub Desktop.
UV light protector
let UV = 0
basic.forever(() => {
UV = input.lightLevel()
if (UV < 190) {
basic.showIcon(IconNames.Yes)
basic.pause(1000)
basic.showIcon(IconNames.Happy)
basic.pause(1000)
} else if (UV >= 190) {
basic.showLeds(`
# . . . #
. # . # .
. . # . .
. # . # .
# . . . #
`)
basic.pause(1000)
basic.showIcon(IconNames.Sad)
basic.pause(1000)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment