Return to IoT Kits

3. Prepare the Arduino IDE

The Arduino IDE is an easy-to-use C++ compiler specially adapted to programming Arduino-compatible microcontrollers. You do not actually need to know how to program because all the IoT Kits software is ready-to-run. The IDE will upload the IoT Kits firmware to the microcontroller used in the kits.

There are many tutorials online. Try this YouTube tutorial from www.opensourcehardware.com: https://www.youtube.com/watch?v=YDkdVZ7e3OY 

After installing the IDE you must install the ESP8266 core that enables the microcontroller used in the kits to understand the Arduino code.

  1. Download and install the Arduino Integrated Development Environment (IDE) on your PC. The latest version is 1.8.9 at www.arduino.cc/en/Main/Software.  Select “Windows Installer, for Windows XP and up” or “Mac OS X 10.8 Mountain Lion or newer”. You can make a contribution if you wish or you can select “Just download”.
  2. Start the Arduino IDE and open File | Preferences. Check “Display Line Numbers” and “Enable Code Folding”.
  3. Add the ESP8266 core with the instructions in steps 1 & 2 below. For reference see https://github.com/esp8266/Arduino and watch this video: https://www.youtube.com/watch?v=7St5Ra21Cpw this one: https://www.youtube.com/watch?v=q2k3CzT5qE0&t=322s
    1. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into “Additional Board Manager URLs” field. You can copy from this web page and paste into the IDE to avoid typing errors. Close the Preferences dialog.
    2. In the IDE, open the Tools | Board | Boards Manager menu and install esp8266 by ESP8266 Community. You can find it quickly by typing esp8266 into the “Filter your search…” field. Click Close when done.
  4. From the Tools | Board menu, select LOLIN(WEMOS) D1 R2 & mini as your microprocessor.
  5. Plug in a Micro USB cable to the D1 Mini and your computer.  It should install a COM port. Set menu item Tools | Port to the COM port of your D1 Mini.
  6. Test the IDE by running the Blink example:
    1. Open menu item File | Examples. Look in the section “Examples for WeMos D1 R2 and mini” Find ESP8266 then Blink. Open the Blink sketch.
    2. Upload the sketch to your D1 Mini by clicking the Upload button or Control + U.
    3. The LED on the D1 Mini will flash every two seconds.
  7. Add the following libraries to the IDE using instructions at https://www.arduino.cc/en/guide/libraries:
    1. BME280 by Tyler Glenn – use Sketch | Include Library | Manage Libraries… Search for BME280
    2. ThingSpeak by MathWorks – use Sketch | Include Library | Manage Libraries… Search for ThingSpeak
    3. BH1750 – download from  https://github.com/claws/BH1750 Install with Sketch | Include Library | Add .ZIP Library…

Permanent link to this article: https://w4krl.com/iot-kits/prepare-the-arduino-ide/