Alex Beck
Created January 27, 2020

Emotional State Rater

10
Emotional State Rater

Story

Read more

Code

Rating Code

JavaScript
let value = 0
forever(function () {
    value = pins.A1.analogRead()
    if (value <= 102) {
        light.setPhotonPosition(4)
    } else if (value > 102 && value <= 204) {
        light.setPhotonPosition(3)
    } else if (value > 204 && value <= 306) {
        light.setPhotonPosition(2)
    } else if (value > 306 && value <= 408) {
        light.setPhotonPosition(1)
    } else if (value >= 408) {
        light.setPhotonPosition(0)
    }
})

Credits

Alex Beck
4 projects • 0 followers

Comments