Home » A look at B4R and ESP32 development

A look at B4R and ESP32 development

by shedboy71

B4R is a development tool that I had not heard of before until today, it is from the makers of basic4Android a development tool that I have heard of.

You download the tool from https://www.b4x.com/b4r.html where they explain the requirements which are Arduino 1.8+ must be installed on your development PC, after you install B4R you setup the path to the Arduino IDE and this is so that they can use the Arduino tools that are installed for compiling and programming.

You may have guessed that this is programming in basic rather than C++ but this is not anything to do difficult to get to grips with, there are a number of tutorials and code examples on the website and also guides to help you out.

Here is my configuration

B4R config

B4R config

Now connect your ESP32 board and open the board selector and choose the options required, here is my ESP32 board connected

B4R board selector

B4R board selector

In Tools -> IDE Options -> Configure Process Timeout I changed from 60 seconds to 120 seconds as I was seeing error messages when compiling, takes quite a while for an ESP32 by the looks of it

The most obvious test is the blink led example


Sub Process_Globals
 Public Serial1 As Serial
 Private Timer1 As Timer
 Private pin5 As Pin
End Sub

Private Sub AppStart
 pin5.Initialize(5, pin5.MODE_OUTPUT)
 Timer1.Initialize("Timer1_Tick", 1000) '1000ms = 1 second
 Timer1.Enabled = True
End Sub

Private Sub Timer1_Tick
 Dim currentState As Boolean = pin5.DigitalRead
 Log("CurrentState: ", currentState)
 Dim NewState As Boolean = Not(currentState)
 Log("NewState: ", NewState)
End Sub


Compile and run this and the on board LED should flash on and off

We will bringing more examples using this development tool


You may also like

Leave a Comment

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.