Skip to content

Commit

Permalink
Disallow higher frequencies until firmware bug is fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyman727 committed May 4, 2014
1 parent c2c2db9 commit 3b6cc41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion examples/accelerometer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var accel = require('../').use(tessel.port("A"));
// Initialize the accelerometer.
accel.on('ready', function () {
// Stream accelerometer data
console.log('waiting for data...');
accel.on('data', function (xyz) {
console.log("x:", xyz[0].toFixed(2),
"y:", xyz[1].toFixed(2),
Expand Down
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ Accelerometer.prototype.getChipID = function(callback) {
};

Accelerometer.prototype.availableOutputRates = function() {
return [800, 400, 200, 100, 50, 12.5, 6.25, 1.56];
return [12.5, 6.25, 1.56];
// Uncomment below and delete above when tessel/beta/issues#256 is fixed
// return [800, 400, 200, 100, 50, 12.5, 6.25, 1.56];
};

Accelerometer.prototype.availableScaleRanges = function() {
Expand Down Expand Up @@ -273,7 +275,9 @@ Accelerometer.prototype.setOutputRate = function (hz, callback) {
self.outputRate = closest;

// Get the binary representation of the rate (for the register)
var bin = self.availableOutputRates().indexOf(closest);
var bin = self.availableOutputRates().indexOf(closest) + 5;
// Uncomment below and delete above when tessel/beta/issues#256 is fixed
//var bin = self.availableOutputRates().indexOf(closest);
// If the binary rep could be found
if (bin !== -1) {
// Read the current register value
Expand Down

0 comments on commit 3b6cc41

Please sign in to comment.