Skip to content

Instantly share code, notes, and snippets.

@bathtimefish
Created October 30, 2017 06:09
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 bathtimefish/ac0479469cab2bb73de284536808b095 to your computer and use it in GitHub Desktop.
Save bathtimefish/ac0479469cab2bb73de284536808b095 to your computer and use it in GitHub Desktop.
Espruino Picoで圧力センサーの値を取得する
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