board707 / w80x_arduino

w806 package for Arduino IDE
GNU Lesser General Public License v2.1
68 stars 12 forks source link

digitalWrite HIGH and LOW seems to be flipped? #37

Closed AllenCyborg closed 4 months ago

AllenCyborg commented 4 months ago

I was trying to run a modified blink sketch to make a pattern on the w801 board. I first tried setting all seven leds HIGH and didn't bother setting them low; so only led1 was getting LOW. I noticed that only LED1 was turning on, then I tried setting other LEDs low one by one.

They seem to turn on when LOW and off when HIGH.

board707 commented 4 months ago

Leds seem to turn on when LOW and off when HIGH

It's true, but the reason is not that the levels in the digitalWrite() are mixed up. The built-in leds on W801 & W806 boards are connected between VCC and mcu pin, so they controlled by LOW level. GPIO LOW - LED ON GPIO HIGH - LED off In contrast, on the air103 board with the same controller, the LEDs are connected between pin and GND and are switched ON by HIGH level.

board707 commented 4 months ago

I added W801 schematic to the doc folder: doc/W801-KIT-V1.0-schematic.pdf

AllenCyborg commented 4 months ago

The built-in leds on W801 & W806 boards are connected between VCC and mcu pin, so they controlled by LOW level. GPIO LOW - LED ON

Thanks, that makes a lot of sense...