B4R Tutorials

ESP8266 + UDP + BMP180 = Simple weather station

This is an example of how UDP can be used to broadcast the current temperature and pressure to one or more clients.

The nice thing about it is that there is no server involved. The ESP8266 just...
 

Attachments

  • B4R_Weather.zip
    1.1 KB · Views: 1,990
  • B4J_Weather.zip
    981 bytes · Views: 1,298
  • B4A_Weather.zip
    7.8 KB · Views: 1,932
  • B4i_Weather.zip
    2.3 KB · Views: 1,039

ESP32 Mesh example

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

Internal Thermometer and Hall Effect Sensor of ESP32

Here I share some examples of how to use the thermometer and the Hall effect sensor in an ESP32. I hope and it will be useful
 

Attachments

  • ESP32internalHall.zip
    868 bytes · Views: 501
  • Temperature.zip
    977 bytes · Views: 491

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:

Setting and Reading date and time of a DS1302 (RTC) without a library

I have one of the "MH-REAL-TIME CLOCK MODULES - 2" with a DS1302 chip. I thought it would be interesting to see if I could read the seconds, minutes, hours, year, month, day of month, and day of...
 

Attachments

  • b4rReadDS1302manually.zip
    2.2 KB · Views: 509
  • DS1302 Real Time Clock.pdf
    354.3 KB · Views: 568

SSD1306 Module

I've been working with SSD1306 OLED for long time, in some projects I was in need to add some special fonts and add some graphics or icons like blue tooth symbols. I thought to put all these...
 

Attachments

  • SSD_module.zip
    24.5 KB · Views: 576
Last edited:

Analog Read Example using LCD

Attachments

  • B4RHowToTMP36LCD.zip
    1.8 KB · Views: 603

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:

Shift Registers (Serial In Parallel Out - Parallel In Serial Out)

This is a very useful tutorial by the guy in dronebotworkshop which opened new horizons for me since I didn't know there were two kinds of shift registers (actually four). Enjoy:

 
Last edited:

Random Numbers from 0 to 255 (byte)

Attachments

  • b4rRandomNumber.zip
    1.3 KB · Views: 404

[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:

Programming an ESP8266 (ESP-12x) via a USB to Serial adaptor

Programming an ESP-12x module directly is not too difficult. If you purchase an ESP8266 with a built-in USB port like a WeMos D1 Mini or a NodeMCU etc, then you do not need to do this as the...
 
Last edited:

Arduino - PC File Transfer

In this example the Arduino board acts as a server. Clients can list the available files and can download files stored on the SD card, which is part of the Ethernet shield...
 

Attachments

  • B4J_FileTransfer.zip
    3.2 KB · Views: 1,094
  • B4R_FileTransfer.zip
    1.6 KB · Views: 1,168
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:

Dronebot workshop - Seeeduino Xiao

Here is a very interesting video by the guy in Dronebot Workshop. This board seems amazing. I suppose since it is Arduino compatible it can also work with B4R with the exception of the commands...
 

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

Big-endian and Little-endian

I didn't know what was the difference was between Big-endian and Little-endian, so I just looked up about it on the internet as I needed to know the difference for a sketch I was converting. I...
 
Last edited:

BLE (HM-10 module) - Broadcasting a single byte

SS-2016-04-13_17.54.33.jpg


In this example I'm using a BLE shield to broadcast the state of a connected button.

The byte is sent as part of...
 

Attachments

  • B4A_BLE_ButtonState.zip
    7.9 KB · Views: 1,234
  • B4i_BLE_ButtonState.zip
    2.9 KB · Views: 734

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:
Top