Public App As Application
Private Page1 As Page
Private astream As AsyncStreams
Private ser As B4RSerializator
Private socket As Socket
Private btnS0 As Button
Private btnS1 As Button
Private lblIP As Label
Private lblStatus As Label
If you’re thinking this looks a bunch like the B4R code,
you’re right. The cool thing about B4R and B4I is that if you
learn to code in one, you can code in the other. As you
can see in our Process Globals assignments, we are coding
with AsyncStreams and B4RSerializator on the iPhone end
Before we touch the Connect button, we must enter
the IP address of the D1 Mini server. If you take a peek
back at the B4R code, the Mini’s IP address is displayed in
n FIGURE 1. These LED images
were very easy to create. There are
plenty of tutorials on the Internet that
describe in detail how to draw these
types of graphic images.
n SCREENSHOT 2. The B4R development platform
automatically programs the WEMOS D1 Mini upon
successful compilation of the target source code. In this
case, we have instructed the Mini to cough up its server IP
address in the log area of B4R.
If you think about that, it is a must. We have to have
an “other end” to our data pipe (AsyncStreams), and we
must be able to encode and decode on both ends of the
link with B4RSerializator.
touched. The Connect button is actually the blue RF
graphic to the right of the IP address text box.
The NavigationController is iPhone related and you
can get the gist of what it does by its name. Since the D1
Mini is a Wi-Fi device and Wi-Fi flows over TCP/IP, sockets
are involved. A socket is no more than an IP address that is
associated with a port address.
The trio of buttons (S0, S1, and S2) is shadowed by a
trio of associated blue LED indicators called imgvLedDx.
The LED indicators are image views that will contain
either the ON or OFF version of the blue LED. The blue
LED graphics you see in Figure 1 were created using
The IP address textfield is used to input the address
of the WEMOS D1 Mini server. Once the IP address is
entered, the Connect button is used to kick off the code
for the connection to the server. The status label will shift
its graphic payload between a broken red chain and green
linked chain, depending on the status of the connection to
the Mini server. The data object is an array that is used in
the B4RSerializator encoding and decoding processes.
We are ready to move into making things happen.
Let’s initialize the B4RSerializator and show our Visual
tutorials on the
describe how to
create the LED
images. Each of
and OFF when
Private Sub Application_Start (Nav As
February 2018 55