diff --git a/lib/index.js b/lib/index.js index feda0b5..ae6f1bd 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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 @@ -283,7 +285,7 @@ Port.CMD = { STOP: 0x14, ANALOG_READ: 0x18, ANALOG_WRITE: 0x19, - }; +}; Port.REPLY = { ACK: 0x80, @@ -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); }