Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (35 sloc) 0.929 kb
<html>
<head>
<title>Read an I2C pressure/temperature sensor</title>
<script src="bonescript-demo.js" type="text/javascript"></script>
<script src="bonescript.js" type="text/javascript"></script>
<script>
setTimeout(startEditor, 1000);
function startEditor() {
demoEdit('code');
}
</script>
</head>
<body>
<h1>Read an I2C pressure/temperature sensor</h1>
<table><tr>
<td width="800px">
<div id="buttons"></div>
<hr />
<pre id="code">
var b = require('bonescript');
var i2c = '/sys/class/i2c-adapter/i2c-1/';
b.writeTextFile(i2c + 'new_device', 'bmp085 0x77');
b.readTextFile(i2c + '1-0077/temp0_input', myAlert);
function myAlert(data) {
alert(JSON.stringify(data));
}</pre>
<hr />
</td>
<td>
<img align="right" height="500px" src="images/beaglebone_with_bmp085_bb.png" />
</td>
</tr></table>
<h2><a href="demo_bmp085_graphing.html">Now let's graph the data</a><h2>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.