B4R Tutorials

Using PROGMEM to save memory

The smaller Arduinos like the Arduino Uno have 2k of RAM. The subs stack and the global variables use this memory.

If your program includes constant data then you can use PROGMEM to store the...
 

ESP32: AES-256 with IV (CBC, PKCSNoPadding) example via Inline C

Finally I got it working. Maybe the Inline C code is not that elegant :) I was too lazy to add a Salt (which I will update later). Hardest part (for me as I don't like C since the 90ies) was to...
 
Last edited:

ESP32: Simple OTA/Update via WebServer

This example (adapted from the Arduino examples under Arduino->File->Examples)

- downloads a file from a server (exactly: the update file)
- store this file to the filesystem (SPIFFS)
- starts an...
 

ESP32: Download huge file from a server and save it

This example downloads a file from a server folder (here I use a folder in htdocs on my apache server) and saves it to a file on the file system. Tested with 700KB files. Set headers (browse the...
 

Controlling an RGB Led from the PC

Attachments

  • B4J_ColorPicker.zip
    4 KB · Views: 701

Using a Wemos D1 R2 and stepper motor - control over wifi

This may be of interest to someone. I am using a Wemos D1 R2 in AP mode to serve a webpage to a client. The Wemos creates a server called "Wemos_Server" using the IP 192.168.4.1.

When the browser...
 

Analog Read Example

Hi,

a simple analog read example which reads the temperature from sensor TMP36 and logs the result.
B4X:
Sub Process_Globals
    Public Serial1 As Serial
    Private TempSensorPin As Pin...
 

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:

OLED displaying data from a USB to Serial com port using AsyncStreams - B4R, B4J and VB.Net

Here is a really simple tutorial with source code on how to send data through a computer com port or laptop USB to Serial com port to receive data on your Arduino based microcontroller board. I...
 
Last edited:

Using an incremental rotary encoder

This is a quick tutorial on what an incremental rotary encoder (or rotary encoder for short) is and what it can be used for.

A rotary encoder is an electromechanical device that generates an...
 
Last edited:

ESP32 Mesh example

Reading Date, Time, and Temperature from a DS3231 RTC module (I2C) using any 2 digital configured pins from an Arduino

Cracked it - can connect the DS3231 to any 2 digital pins of my Nano and read the date, time, and temperature by making use of the B4A core library only. All control of the SDA (data) and SCL...
 

Attachments

  • b4rReadDS3231manually.zip
    3.2 KB · Views: 507
  • datasheet.pdf
    297.8 KB · Views: 541
Last edited:

Servo Motor controlled via IR Remote Control

Hi,

an experiment to move a Little Crane arm (used some Lego parts) up and down via IR Remote Control (Key1=UP,Key2=DOWN). When the arm moves, the Red LED lights else the Green LED is...
 

Attachments

  • B4RHowToServoMotorCrane.zip
    245 KB · Views: 962
Last edited:

PS4 F1 2020 Interfacing using ESP8266

1 - INTRODUCTION

Hi Guys,

My wife's eldest son is addicted to PS4 F1 2020 game, even bought himself a Rig for a Steering Wheel and Pedals.
He works alongside with me and on one of...
 
Last edited:

B4R & B4J MQTT display DHT11 sensor data Google Line Chart

Hi,

as an example build a B4R & B4J solution to display DHT11 sensor data (Temperature & Humidity) in a google line chart created and refreshed by a B4J webserver.

Update 2016.05.24
There...
 

Attachments

  • B4RHowToDHT11MQTTGoogleChart.zip
    29.2 KB · Views: 766
Last edited:

tone() function

Here is a tone function that does Arduino's tone()
The buzzer is connected between pin 6 and ground :
B4X:
Private Sub AppStart
    Serial1.Initialize(115200)
    Log("AppStart")
    Delay( 1000)...
 
Last edited:

BLE Xiaomi Temperature Sensor Project (ESP32 with BLE+WIFI)

1619127624585.png


My office gets cold overnight in winter. I have a heater which has a basic thermostat but its very inaccurate (its just a min/max dial not temperature based). If I leave it on...
 

Attachments

  • ESPXiaomi.zip
    2.3 KB · Views: 679
Last edited:

8x8 LED Matrix with 788BS

It is based on this Arduino project with the following wiring diagram:

matrix_connections_s9OJ43nrTc.png


It uses the 788BS 8x8 LED matrix (red) to display numbers/characters/other stuff (without making...
 

Attachments

  • b4rMakeSenseOf8x8LEDmatrix.zip
    1.9 KB · Views: 523
Last edited:

Use and change font in rAdafruitGFX for TFT screen

The library rAdafruitGFX is used to draw on TFT screens. It has a default font and does not give a way to change the font for drawing text.
This is what I got when drawing very large characters...
 
Last edited:

Using RSA on a ESP32 via Inline C

Top