WiringPi / WiringPi-Node

Node.js bindings to wiringPi
334 stars 94 forks source link

pinModeAlt not working as it should #24

Closed dirkels closed 9 years ago

dirkels commented 9 years ago

Wanting to set the alt modes of pins I tried to use this function to set the ALT0 (4) mode of a pin finding that it does not work. This because the modes are limited to WPI_MODE_PINS (0), WPI_MODE_PHYS (3), WPI_MODE_GPIO (1-GPIO_OUTPUT). These three constands are to specify how the pin numbers arguments are translated and have nothing to do with the operational mode of a pin. Instead the following defines from wiringPi.c should be used: FSEL_INPT (0) FSEL_OUTP (1) FSEL_ALT0 (4) FSEL_ALT1 (5) FSEL_ALT2 (6) FSEL_ALT3 (7) FSEL_ALT4 (3) FSEL_ALT5 (2)

nekuz0r commented 9 years ago

Good catch, will fix that :)