B4R Tutorials

Setting Date and Time of a DS3231 RTC module (I2C) using any 2 digital configured pins from and Arduino

The attached project implements the I2C communication protocol to set the Date and Time of a DS3231 RTC module. The protocol is hard coded (i.e no library) and you can therefore use any 2 digital...
 

Attachments

  • b4rWriteDS3231manually.zip
    3.5 KB · Views: 454
  • datasheet.pdf
    297.8 KB · Views: 456

B4R PIR (Passive Infrared Sensor) Example

Thanks to Erel for this great product !! (again)

Here's a PIR example (presence detection) with Arduino and B4R; the PIR sensor is the PIR HC-SR501...
 

Stepper motor

Edit: see post #5 for an updated version.

This application is controlling a stepper motor which can be turned by a wanted angle and speed. I use this motor...
 
Last edited:

Inertial Measurements (MPU 6050) and Magnetometer (HMC5883L)

With big help from Erel here are two examples of connecting two boards by the I2C/TWI (A4 and A5 pins), using the rWire library.
Inertial Measurements (mpu6050) :
B4X:
' MPU 6050 board - Inertial...
 
Last edited:

Weather Station using MQTT, UDP and Thingspeak

This is my humble effort to produce a weather station (based on this project). You will need:

1 x Wemos D1 Mini
1 x BME280 Sensor
1 x TP4056 Li-Ion Charging board
1 x 3.7V Li-Ion Battery
1...
 
Last edited:

AsyncStreams Prefix Mode

rRandomAccessFile v1.80 adds support for AsyncStreams in prefix mode.
All B4X development tools use AsyncStreams for network communication and now all of them support prefix mode...
 

Visualizing ADXL345 3-axis Accelerometer Pitch and Roll with inline C and Processing

The attached project is based on this posting:

Have downloaded and installed...
 

Attachments

  • b4rADXL345InlineC.zip
    1.8 KB · Views: 482
  • sketch_200215a.zip
    970 bytes · Views: 491
Last edited:

Mini Weather Station with LCD

Hi,

a Mini Weather Station experiment displaying on a 16x2 LCD the Temperature + Humidity (Line1) and Pressure + Altitude (Line2).
In addition, a trendindicator (=,+,-) is shown for each...
 

Attachments

  • B4RHowToLiquidCrystalWeather.zip
    114.6 KB · Views: 633
Last edited:

[Tool]LCD Char maker

Hi,

LCD Char Maker Tool.

1583839289413.png


Functionality
  • Create custom LCD character with 5 pixel horizontal (cols), 8 pixel vertical (rows).
    Each row is represented by a byte with 5...
 
Last edited:

B4R/B4J Experiment - Control Servo Motor connected to Arduino via Browser

This experiment moves a Little Crane arm (used some Lego parts) up and down via browser connected to a B4J websocket server.
When the arm moves, the Red LED is turned on else the Green LED is on...
 

Attachments

  • b4rhowtoservomotorbrowser.zip
    254 KB · Views: 645
Last edited:

Getting local date & time (easy and free)

I saw a post or two about how to get the local date & time with no easy answers. I need this myself for my first Arduino project so I had a look around and found a free API that does just this...
 

HX711 code module

Hello;
this code module is for using HX711 load cell amplifier board with Arduino, I used it with UNO and MEGA without any problems, only 4 pins are required for voltage supply and communication...
 

Attachments

  • HX711.bas
    2.2 KB · Views: 576
Last edited:

Home Control 4

Hi guys
I want to share my project on this great community (source code free no donation)
I think it may be useful to someone
in the source code I commented out the functions
it should be simple...
 

Attachments

  • B4A-HomeControl.zip
    13.4 KB · Views: 256
  • B4J-HomeControl.zip
    4.4 KB · Views: 226
  • B4R-Home-Control.zip
    2 KB · Views: 248

B4R sending DHT11 data to B4J server which displays a Google Line Chart

An example of a DHT11 sensor connected to an Arduino interacting with B4J server application.
  • A B4R program gathers every 10s sensor data and sends the data in JSON format via UDP to a B4J...
 

Attachments

  • B4RHowToDHT11UDPGoogleChart.zip
    14.3 KB · Views: 669

Controlling DSTV decoder from Android device via Nano and HC-05 bluetooth module

Just for the fun of it. Can now control my Digital Satellite TV decoder from anywhere in my house....
Nano connected to the HC-05 module
B4A app connects to the HC-05 and sends the B4A "button...
 

Attachments

  • b4aHC-05.zip
    31.2 KB · Views: 423
  • b4rHC05.zip
    2.9 KB · Views: 403

Full responsive ESP8266 settings WebApp with websockets

Merry Christmass everyone in the Christian community of this forum,

Yesterday I 've had a great crazy idea which turned out to be a working one too.

Normally one would answer to the question if...
 

Attachments

  • B4RWebApp.zip
    5 KB · Views: 510
  • B4RWebServer.zip
    2.8 KB · Views: 533
Last edited:

Analog Read Example using Ethernet

Hi,

based on previous Analog Read Example extended the solution by using the Arduino Ethernet Shield to send temperature data to B4J server and receive confirmation.
Full project (with...
 

Attachments

  • B4RHowToTMP36Ethernet.zip
    4.6 KB · Views: 531

Node-Red MQTT controlling 8 relays ESP32

Hi
Here a sample program to control 8 outputs on arduino ESP32. The program use the MQTT protocol to exchange the data (really a single byte). By Node-red web interface the user set or reset the...
 

Attachments

  • 8_relay_ESP.Nodered_example.zip
    154.2 KB · Views: 598

Analog Read Example using LCD

Attachments

  • B4RHowToTMP36LCD.zip
    1.8 KB · Views: 612

[B4x]: Exchange AES-256 encrypted messages between ESP32 and B4x

This is about how to exchange AES256 encrypted messages incl. generated IV (initialization vector) between a ESP32 and B4x.

Notes:

- the ESP uses AES/CBC/NoPadding. The data must be padded (must...
 

Attachments

  • B4J_ESP32_AES.zip
    4.5 KB · Views: 495
Top