nodesign / weio

weio
http://we-io.net
128 stars 35 forks source link

examples: bgColorLEDWEB : Fixed color position and value #252

Closed ks156 closed 8 years ago

ks156 commented 8 years ago

LED was not correctly set, and values must be inverted (LED ON = 0; LED OFF = 1)

drasko commented 8 years ago

LGTM, but unfortunetly because of the inverted logic whole examples become harder to exmplain to beginers and newbies.

Can we work something around this inverted logic? I know that this should have been done in HW, but we are where we are and maybe some SW wrap about GPIO logic that control LED can be done so that LED is ON when these GPIOs are wtitten HIGH by userspace (and leter inverted in the weioLib behind the users back)?

ks156 commented 8 years ago

We need to add cases for pin 18, 19 and 20. But in this case, if someone want use these pins for something else than the LED, the signals will be inverted for him ...

drasko commented 8 years ago

True, but this can be noted in the doc. Only question is is it worth (and intelligent) to break the consistency because of the examples... Not sure. Opinions?

ks156 commented 8 years ago

I would prefer add a note to explain why the LEDs are inverted instead of adding special case for them

drasko commented 8 years ago

ACKed and merged.

ks156 commented 8 years ago

@drasko : Did you see my second commit ?

drasko commented 8 years ago

Yeap, nice enough documented IMHO.

ks156 commented 8 years ago

Ok. I was not sure because I think you were occupied to merge my first commit when I've pushed the second one :stuck_out_tongue: