3dsimo / 3dsimo_kit

71 stars 37 forks source link

Quick fix: The if-checks for the up & down buttons seem confused #5

Closed AnTi-ArT closed 5 years ago

AnTi-ArT commented 5 years ago

The pins are right, but the if-checks in lines 353 and 372 had the "!" confused. Or maybe I'm confused. This works for righthanded without changing the Pin numbers. Because according to the Wiring Diagram UP = D11, DOWN = D12

AnTi-ArT commented 5 years ago

Sorry, looks like I actually am confused! I just noticed that the other two buttons work the same way: If not HIGH/true, do the button action. I checked the pins of EXT and REV, and they are correct. I tried to change the if checks - no, it only works with "!". Finally I simply digitalWrite(LED_NANO, digitalRead(BTN_EXT)); and the buttons really are HIGH when unpressed and LOW when pressed.

A bit confusing.

I guess I will just close the PR then (will add the typo fix somewhere else).

MisterScott commented 4 years ago

It has to do with hardware conventions: a switch closure to ground to activate a function is compatible with any AC or DC voltage level, a pull-up resistor on the input, an RC reset delay circuit, etc.
This does have the effect of a pressed button being read as a 0.