Created
October 30, 2017 06:09
-
-
Save bathtimefish/ac0479469cab2bb73de284536808b095 to your computer and use it in GitHub Desktop.
Espruino Picoで圧力センサーの値を取得する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = setInterval(function() { | |
var val = analogRead(B1); | |
console.log(val); //圧力センサーの値 | |
if(val < 0.5) { //値が0.5以下になるとLEDが点灯する | |
digitalWrite(A8, 1); | |
} else { | |
digitalWrite(A8, 0); | |
} | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment