54 August 2017
B4R — aimed at Arduino program development — is a
cousin to B4A (formerly called Basic for Android). B4R is
also related to B4J, a Java based RAD (Rapid Application
Development) program development environment. You
pay for a B4A license. B4R and B4J are free. B4R uses the
resources provided by the Arduino family of libraries. B4R
also provides native support for the ESP8266 and can be
used to develop firmware for many Arduino boards. The
ESP8266 support is why we are here.
The Arduino IDE (integrated development
environment) must be installed before you can use B4R.
You’ll need to install the latest and greatest Arduino IDE.
The next step is to install B4R and configure the paths.
This is done within B4R and simply sets the directory path
to the Arduino IDE. You can also optionally specify
directories for additional libraries.
Once you have your Arduino paths laid out, the next
step is to load some target hardware support information
into the Arduino settings as you can see in Screenshot 1.
Adding the Additional Boards Manager URL enables
support for our target hardware, which happens to be the
WeMos D1 Mini smiling in Photo 1.
We can now dive back into the B4R IDE and
introduce our new WeMos D1 Mini to the B4R IDE. We
have done just that in Screenshot 2. The B4R IDE sensed
the WeMos D1 Mini via the COM port connection
between it and the Mini. At this point, we can use the
B4R IDE to produce ESP8266 firmware and load it into
the WeMos Mini using a simple USB connection.
The WeMos D1 Mini
The WeMos D1 Mini circuitry is not at all
Try the RAD B4R for ESP8266 Coding
■ BY FRED EADY
The ESP8266 has become a very popular way to add a Wi-Fi communications link
to almost anything. The ESP8266 hardware is easy to use, and firmware
development for it is widely supported by multiple development suites. Python
seems to be a popular development tool for the ESP8266. However, if you don’t
do C, odds are you don’t do Python either. If you have the sand (cowboy talk for
bravery), you can code for the ESP8266 using the native development
environment offered by the manufacturer. Then there’s LUA. I’ve tried them all.
However, my favorite is a Johnny-come-lately tool called B4R.
THE DESIGN CYCLE
■ PHOTO 1. The WeMos D1 Mini is based on the
ESP8266. Everything we need to program and use the
ESP8266 are on the WeMos D1 Mini PCB.
■ SCREENSHOT 1. Performing this
operation adds support for our target