B4R Tutorials

Using Firebase to send notifications to iOS and Android devices

Attachments

  • ESP8266_Push.zip
    1.5 KB · Views: 2,314

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:

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...
 

Use Rasberry Pi Pico with the Arduino IDE and thus with B4R

 

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:

Updated RSA Encryption between B4x and ESP32's (any other plattform will do, too)

Here's an updated example how to

- generate an RSA keypair (Public and Private key) on a ESP32 and on B4x
- export these keys in PEM format (compatible with any other plattform like B4x, .net...
 

Attachments

  • ExchangeKeysB4J.zip
    5 KB · Views: 392
  • ExchangeKeysB4R.zip
    4.4 KB · Views: 396

Updated B4R-AES256 example (compatible with B4x, php and all other platforms)

This is an updated example how to en-/decrypt data with AES256.

Libs needed: jRandomAccessFile only

Notes:

- As far as I know, the ESP32 doesn't support padding like PKCS5/7, so I had to do it...
 

Attachments

  • ESP32AES256.zip
    2.3 KB · Views: 402

Ultrasonic Ranging module HC-SR04

Testing the HC-SR04 to measuring distances

ultrasonic_sensor_schema.jpg

physics info.png

The accuraccy of the sensor depends greatly on...
 
Last edited by a moderator:

UDP Communication

rEthernet library v1.10 (included in v1.00 beta 9) includes a new type named EthernetUDP. It allows sending and receiving UDP packets.

UDP is simple to work with as it is a connection-less...
 

Attachments

  • B4A_UDP.zip
    8.1 KB · Views: 1,420

u-blox ThingStream - Nina W106 - blog

Tutorial vs Creation : Clarification

Hi Guys

EREL is a very busy guy, and sometimes he prefers to give us some freedom on some emplacements for our Posts.

Since the advent of B4R many tutorials have been posted portraying the usage...
 

Traffic Light Example

Example of implementing a "traffic light" with 3 leds. There are four states: red, red + yellow, green and yellow.

It uses CallSubPlus to switch to the next state after the current state...
 

Touch switch

Hello all
This is the same as Erel's "Button Example" modified by Klaus. All what I did is replacing the mechanical switch with a touch switch module. So simple that the images speak for...
 
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:

Tips to use an M5Stamp-C3U

It's a very small and quite powerful ESP32-board with WIFI/BLE and B4R support!

Use following board library in the Arduino-IDE in 'Settings'...
 

Timers, Loopers and CallSubPlus

Arduino C example #1:
B4X:
void setup() {
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the...
 
Last edited:

TIME to Uint / Unit to TIME Converter

I using this code, Because Board has a problem for records size capacity of epprom.

Sample
B4X:
Log("17:45:36 False >>",DateTime.TimeToUint(17,45,36,False)) '>>> 1065
    Log("1065 // 17:45:36...
 
Last edited:

TFT displays: TFT_ESPI (inline C) example

Update:

1. Init Display as a separate sub
2. TFT_ESPI as "global"
3. Drawtext as a sub with parms
4. Updated example


Although there is a library and I appreciate the good work, I like to...
 

Attachments

  • TFT_B4R.zip
    1.4 KB · Views: 46
Last edited:

sub for Date Time adding

Hello;
I needed date time functions; And some write codes.
it is first sharing with B4R

use this variables for date &time
Public Time_HH As Int
Public Time_MM As Int
...
 
Last edited:

Strings and Bytes

B4R strings are different than in other B4X tools. The reasons for these differences are:
1. Very limited memory.
2. Lack of Unicode encoders.

A String object in B4R is the same as C char*...
 
Last edited:
Top