B4R Tutorials

Digital Clock and Alarm without using a RTC

A digital clock and alarm without making use of a RTC. It uses:
Uno R3
LCD 1602 (to display the clock and the alarm)
Piezo Buzzer (to sound the preset alarm)
10K Pot (adjust the contrast of the...
 

Attachments

  • JHS_CLOCK.zip
    2.2 KB · Views: 780
Last edited:

DHT11 & DHT22 temperature and humidity sensors ARDUINO UNO Code

This B4R example/library works with DHT11 and DHT22 temperature and humidity sensors:

This inexpensive device (DHT11) allows for measure temperature and humidity:
  • Very Low cost
  • 3...
 

Attachments

  • upload_2016-4-22_12-12-25.png
    upload_2016-4-22_12-12-25.png
    11.7 KB · Views: 1,316
  • DHTlib.zip
    10.1 KB · Views: 1,313
  • rDHTv2.zip
    1.2 KB · Views: 1,120
Last edited:

DATE to Uint / Unit to Date Converter

I using this code, Because Board has a problem for records size capacity of epprom.
B4X:
'For date >> 2015/ 08 / 04 (y/m/d)
Log("Date number:",DateTime.DateToUint(15,8,4)))
'returned >>
'Date...
 
Last edited:

Data types

The following data types are available in B4R:

Numeric types:

Byte: 0 - 255
Int (2 bytes): -32768 - 32768. Similar to Short type in other B4X tools.
UInt (2 bytes): 0 - 65535.
Long (4 bytes)...
 

Custom character creation for LCD

I just found this and it looks very promissing:

 

Creating libraries for B4R

Libraries are written in C++.
Libraries are made of a single h file and one or more cpp files. Libraries can also include other h files which will not be exposed.

All the files should be in the...
 

Attachments

  • B4Rh2xml.jar
    98 KB · Views: 1,390
Last edited:

Correct this misconseption - "Call B4R subs from InLine c code" - see post #2

Having had my work flow cut down in the middle by vicious "circumstances" I decided to let it all go and "go fishing" as mr. Miyaghi (Karate kid) would say. So I did some things I couldn't do...
 
Last edited:

Controllino Mega PLC Examples

Attached is a B4R project (using inline C) to manipulate the ports of the Controllino Mega. In this project we do the following:
1. Toggle the OVL (over voltage) LED of the PLC between on/off...
 

Attachments

  • ControllinoPorts.zip
    1.2 KB · Views: 41

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: 430
  • b4rHC05.zip
    2.9 KB · Views: 411

Controlling an RGB Led from the PC

Attachments

  • B4J_ColorPicker.zip
    4 KB · Views: 702

Control servo and relays using Nextion lcd display

I'm new in b4r but thanks to the help of the forum i made some progress.
So i decided to share my project with all, especialy the newbies like me.
My project is a simple example on how to control...
 

Attachments

  • Nextion.zip
    417 KB · Views: 972

Connecting two ESP8266 boards

In this example one of the boards acts as an access point and a server and the other board connects to the server wifi network and to the server socket.

Note that for the client to be able to...
 

Connecting two Arduinos with rWire library

SS-2016-04-12_16.46.55.png


The rWire supports communication with other I2C/TWI devices.

One device acts as the master and the other devices act as...
 

Connecting two Arduinos with rSoftwareSerial library

SS-2016-04-13_15.50.49.png


With the rSoftwareSerial library you can turn regular pins to serial ports. This is useful as the hardware serial is used...
 

Attachments

  • rSoftwareSerial.zip
    1.7 KB · Views: 1,435

Connecting to Arduino with BLE (Bluetooth Low Energy)

Attachments

  • B4i_BLE.zip
    3.1 KB · Views: 1,200
  • B4A_BLE.zip
    8.5 KB · Views: 2,030
Last edited:

Connecting ESP8266 and Arduino with rSoftwareSerial library

An example of connecting an ESP8266 (NodeMCU used for this experiment) and an Arduino MEGA.
The Arduino runs B4R and the ESP8266 runs ESP8266 Basic.
Note 1: Using ESP8266 Basic is for the...
 
Last edited:

Connecting an actual building\house alarm PIR sensor

This is a tutorial on how to connect an actual building\house alarm PIR sensor to an Arduino and how to interpret 5 alert states (the resistance results). The advantages of using the PIR sensor in...
 
Last edited:

compilation language: arduino-cli config

Last edited:

Circuit analysis to the maximum

This is a very detailed analysis on circuit analysis comprising of two videos. They are huge videos (1,5 hours almost each) but believe me it worth it seeing them. I faced all these subjects in...
 

Check the solderings of a WeMos D1 Mini

When you buy a WeMos it doesn't come assembled with the pins soldered. You will have to solder the pins. In the following schematic and code you will find a way to check the solderings of GPIO...
 
Last edited:
Top