Skip to content

Commit

Permalink
Fixing first digital/analog readings in chromium operation. Just insi…
Browse files Browse the repository at this point in the history
…de 1.2.7 version
  • Loading branch information
jguille2 committed Oct 18, 2018
1 parent df5ac4c commit 2a35a7c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/platforms/web/chromium/root/plugin/threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ Process.prototype.reportAnalogReading = function (pin) {

if (board.pins[board.analogPins[pin]].mode != board.MODES.ANALOG) {
board.pinMode(board.analogPins[pin], board.MODES.ANALOG);
board.pins[board.analogPins[pin]].report = -1;
} else {
if (board.pins[board.analogPins[pin]].report == 1) {
if (board.pins[board.analogPins[pin]].report == -1) {
board.pins[board.analogPins[pin]].report = 1;
} else if (board.pins[board.analogPins[pin]].report == 1) {
board.pins[board.analogPins[pin]].report = 0;
board.getAnalogPinValue(board.analogPins[pin]);
} else if (board.pins[board.analogPins[pin]].report == 2) {
Expand All @@ -35,8 +38,11 @@ Process.prototype.reportDigitalReading = function (pin) {
if (board.pins[pin].mode != board.MODES.INPUT) {
board.pinMode(pin, board.MODES.INPUT);
board.reportDigitalPin(pin, 1);
board.pins[pin].report = -1;
} else {
if (board.pins[pin].report == 1) {
if (board.pins[pin].report == -1) {
board.pins[pin].report = 1;
}else if (board.pins[pin].report == 1) {
board.pins[pin].report = 0;
board.getDigitalPinValue(pin);
} else if (board.pins[pin].report == 2) {
Expand Down

0 comments on commit 2a35a7c

Please sign in to comment.