Last active
August 29, 2015 14:23
-
-
Save gyengus/9dbee43b755aebdcd56e to your computer and use it in GitHub Desktop.
Espruino Pico BMP180 example
This file contains 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
I2C1.setup({scl: B6, sda: B7}); | |
var bmp = require("BMP085").connect(I2C1, 3); | |
function readBTN() { | |
if (digitalRead(BTN1) == 1) { | |
LED1.write(true); | |
bmp.getPressure(function(d) { | |
console.log(new Date().toString()); | |
console.log("Pressure: " + d.pressure + " Pa"); | |
console.log("Temperature: " + d.temperature + " °C"); | |
LED1.write(false); | |
}); | |
} | |
} | |
setWatch(readBTN, BTN1, true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment