Skip to content

Commit

Permalink
fix digitalReadPin() simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Nov 21, 2023
1 parent e891234 commit b9a1110
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sim/state/edgeconnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ namespace pxsim.pins {
let pin = getPin(pinId);
if (!pin) return -1;
pin.mode = PinFlags.Digital | PinFlags.Input;
return pin.value > 100 ? 1 : 0;
console.log(pin.value)
return pin.value >= 1 ? 1 : 0;
}

export function digitalWritePin(pinId: number, value: number) {
Expand Down

0 comments on commit b9a1110

Please sign in to comment.