Skip to content

Commit

Permalink
Version 19.12.13 (R2C)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoblite authored Dec 13, 2019
1 parent e848f50 commit b0e08a4
Show file tree
Hide file tree
Showing 22 changed files with 1,039 additions and 80 deletions.
5 changes: 5 additions & 0 deletions modules/ADS1015.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const i2c = require('i2c-bus'); // -> https://github.com/fivdi/i2c-bus
const SH1107 = require('./SH1107.js');
const IS31FL3731_RGB = require('./IS31FL3731_RGB.js');
const IS31FL3731_WHITE = require('./IS31FL3731_WHITE.js');
const HT16K33 = require('./HT16K33.js');

module.exports = {
Identify: Identify,
Expand Down Expand Up @@ -250,6 +251,10 @@ function Display(refreshAll)
}
}

// ====================

if (HT16K33.IsAvailable()) HT16K33.Display(""); // PLACEHOLDER

// ====================

if (refreshAll) Log();
Expand Down
11 changes: 10 additions & 1 deletion modules/ADT7410.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const i2c = require('i2c-bus'); // -> https://github.com/fivdi/i2c-bus
const SH1107 = require('./SH1107.js');
const IS31FL3731_RGB = require('./IS31FL3731_RGB.js');
const IS31FL3731_WHITE = require('./IS31FL3731_WHITE.js');
const HT16K33 = require('./HT16K33.js');

module.exports = {
Identify: Identify,
Expand Down Expand Up @@ -150,7 +151,15 @@ function Display(refreshAll)
if (IS31FL3731_WHITE.IsAvailable())
{
IS31FL3731_WHITE.DrawString(Math.round(data[0]).toString());
}
}

// ====================

if (HT16K33.IsAvailable())
{
var temperature = data[0].toFixed(1) + 'C';
HT16K33.Display(temperature);
}

// ====================

Expand Down
43 changes: 42 additions & 1 deletion modules/ADXL343.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const i2c = require('i2c-bus'); // -> https://github.com/fivdi/i2c-bus
const SH1107 = require('./SH1107.js');
const IS31FL3731_RGB = require('./IS31FL3731_RGB.js');
const IS31FL3731_WHITE = require('./IS31FL3731_WHITE.js');
const HT16K33 = require('./HT16K33.js');

module.exports = {
Identify: Identify,
Expand Down Expand Up @@ -335,7 +336,47 @@ function Display(refreshAll)
if (data [8] > 0) img[38] = 180;

IS31FL3731_WHITE.Display(img);
}
}

// ====================

if (HT16K33.IsAvailable())
{
// We only have 4 characters to play with (for now at least, without scrolling)
// so let's divide the roll/pitch degrees by 10 and present them in truncated "#R#P" format...

var rollpitch = '';

var roll;
if (data[6] < 0)
{
rollpitch += '-';
roll = -Math.round(data[6]/10);
}
else
{
rollpitch += '+';
roll = Math.round(data[6]/10);
}
if (roll > 9) rollpitch += 'R';
else rollpitch += roll.toString();

var pitch;
if (data[7] < 0)
{
rollpitch += '-';
pitch = -Math.round(data[7]/10);
}
else
{
rollpitch += '+';
pitch = Math.round(data[7]/10);
}
if (pitch > 9) rollpitch += 'P';
else rollpitch += pitch.toString();

HT16K33.Display(rollpitch);
}

// ====================

Expand Down
Loading

0 comments on commit b0e08a4

Please sign in to comment.