Fun with the WEMO D1 Mini

Home

Robots

Building a Metal Melting Furnace

Metalworking

Alternative Power

Classic Computers

Gardening

Community

Links



About this site

Coming soon?

Email the author:
bill@geektrap.com

I played a bit with the D1 Mini some time ago, doing things like an SMTP client, web servers, and so on. Today, I nearly drove myself to distraction trying to do a little simple I/O with it, but having all kinds of mysterious problems, depending on the I/O pin I chose. Example code to, for example, flash the LED on the board worked fine, but my code either locked up the processor, or just didn't pick up changes to the I/O pin. After a bit of web surfing and a lot of head scratching, I figured it out. My early experience with Arduino boards suffered from similar issues, until I figured out that the D1,D2,...etc.designations had no relationship to the actual pin numbers *or* the port/bit designations on the processors themselves! I'd been using CPU pin numbers, when I should have been using the D1/A1 designations (although I'd still like to slap the person who decided to be inconsistent and use A# for the analog bits, but only #, and not D# for the digital bits in the Arduino IDE!!

Accordingly, when I started plugging in wires to the Wemo boards, I thought, "Okay - I know how this works now!" and proceeded to refer to the pins by the D# designations *silkscreened on the PCB*, but NOOOooo! Those have *nothing* to do with the actual I/O bits you have to use for things like, "digitalRead(D1)"! Nor do you use the pin numbers on the chip. You have to look up the GPIO# designations assigned to the various I/O pins on the chip, and use *those*! Of course most of them serve double or triple duty and can't blithely be used for general purpose I/O, so there's that... But *why* for the *love of the FSM* didn't any of the many online tutorials I read bother to mention that little detail??? It's working as expected now, but holy cats, guys! Three levels of abstraction and you couldn't be arsed to say, "OH, AND BY THE WAY, YOU HAVE TO USE GPIO NUMBERS WHEN REFERRING TO THE I/O BITS!"??? I mean, REALLY? *sigh*


[æ]