Skip to content

Instantly share code, notes, and snippets.

@baobao
Created November 20, 2018 00:18
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 baobao/2459cb025e3994dfb5311cb8002f5f6e to your computer and use it in GitHub Desktop.
Save baobao/2459cb025e3994dfb5311cb8002f5f6e to your computer and use it in GitHub Desktop.
basic.forever(function () {
let lightLevel = input.lightLevel();
if (lightLevel <= 2) {
// 一定の暗さになったら腕を回す
basic.showIcon(IconNames.Heart);
servos.P0.setAngle(180);
basic.pause(2000);
servos.P0.setAngle(90);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment