Skip to content

Commit

Permalink
Adding ADC Resolution
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
  • Loading branch information
rwaldron committed Apr 24, 2017
1 parent aaa23fd commit 4708a68
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ const SERVO_FREQUENCY = 50;
const SERVO_MIN = 0.03;
const SERVO_MAX = 0.12;

const ADC_RESOLUTION = 4096;


/**
* ToPinIndex Return the board-wide index of a Pin for a given Pin name, Number, or Index
Expand Down Expand Up @@ -283,7 +285,7 @@ Port.CMD = {
STOP: 0x14,
ANALOG_READ: 0x18,
ANALOG_WRITE: 0x19,
};
};

Port.REPLY = {
ACK: 0x80,
Expand Down Expand Up @@ -587,6 +589,12 @@ class Board extends Emitter {
return 0;
}

get RESOLUTION() {
return {
ADC: ADC_RESOLUTION
};
}

setSamplingInterval(ms) {
samplingInterval = Math.min(Math.max(ms, 5), 65535);
}
Expand Down

0 comments on commit 4708a68

Please sign in to comment.