Friday, October 21, 2016

Programming the Wemos D1 Mini

I have found that there are two viable choices for development (for me) with the Wemos D1 Mini... either the Arduino development environment or MicroPython.

ESP8266 Arduino
Having experience with Arduino is a big help when getting started using that approach.  They have already done alot of the work for you here http://www.esp8266.com/ and all you need to do is add

     http://arduino.esp8266.com/stable/package_esp8266com_index.json

to your board manager and then you can import the libraries.


There is an extensive list of examples, especially dealing with Wifi and Internet communications.

I'm really impressed with the Arduino support for my D1 Mini.  I can access all of my shields (except my neopixel shield) and the code is all C.  It works well and I have to say it would be my main development route if it were not for a couple of reasons.


  1. Deep Code Nesting.
    The libraries of course build on one another, and sometimes you have problems that originate, deep in the library code... which may or may not be C.  It could be C++ which is different.  I was getting errors at high level calls, but was unable to trace it all the way down to where I could understand the problem and fix or work around it.
  2. Difficult Debugging
    Similar to above, there were many reasons why it was hard to get something original big and complex working.



MicroPython
I am not a Python programmer, but am very interested in learning it because of all of its positive attributes.  As I am just starting out, I am copying code more than I am writing it, but I have to say it is a really nice language.

First of all, it is a much higher level of programming... so it takes less code to do the same things.  Instead of layer after layer of C code, it equates to one or two layers of Python and that's it.  Neat.

The second nice thing is that it is REALLY Python 3.0.  As I program the microcontroller, I am learning the "big" Python language as well. Bonus.

Finally, I am finding Python FUN!  After years of C# and VB.NET programming, I am enjoying the simplicity, the readability and the power of Python.


No comments:

Post a Comment