B4R Tutorials

Custom character creation for LCD

I just found this and it looks very promissing:

 

HC 05 Classic Bluetooth

SS-2016-05-08_17.39.25.jpg


SS-2016-05-08_17.39.57.png


In this example we will connect an Android...
 

Attachments

  • Adruino_Bluetooth_B4A.zip
    9.7 KB · Views: 2,639
Last edited:

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: 477
  • sketch_200215a.zip
    970 bytes · Views: 485
Last edited:

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,424

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:

Ethernet / Network Tutorial

This example uses an Ethernet shield to connect to a server. In this case the server is implemented with B4J, though you can easily implement a similar server with B4A or B4i.

Whenever the user...
 

Attachments

  • EthernetExample.zip
    1.2 KB · Views: 1,185
Last edited:

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: 502
  • datasheet.pdf
    297.8 KB · Views: 530
Last edited:

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: 450
  • datasheet.pdf
    297.8 KB · Views: 450

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: 515
  • DS1302 Real Time Clock.pdf
    354.3 KB · Views: 575

LEDStrip - different themes for different holidays

Here is this RGB Led Strip light project I have been playing around with.

I am including the Android program I use to play with colors.

NOTE when using the Android program you can select a theme...
 

Attachments

  • LEDStrip_B4A.zip
    496 KB · Views: 405
  • LEDStrip_B4R.zip
    11.3 KB · Views: 397
  • LEDStrip - Metamucil Jar.jpg
    LEDStrip - Metamucil Jar.jpg
    358.5 KB · Views: 475
  • LEDStrip - Breadboard.jpg
    LEDStrip - Breadboard.jpg
    272.8 KB · Views: 453
Last edited:

EasyEDA - PCB Design CAD

Hi everybody,

looking for free PCB design software I came accross the EasyEDA. It is one of the best I have seen since you get to design multilayered PCBs and see the designed PCB in 3d view...
 
Last edited:

Random Numbers from 0 to 255 (byte)

Attachments

  • b4rRandomNumber.zip
    1.3 KB · Views: 411

Charlieplexing - controlling N*(N-1) LED's with N GPIO pins

It is based on this posting. I am using an Arduino Nano to control the 12 LEDs using pins 8, 9, 10, and 11 of the Nano. Just thought it would be interesting to give...
 

Attachments

  • b4rCharliePlexing.zip
    1.1 KB · Views: 365

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:

B4R Vibration Sensor (shake switch)

So long that I haven't played with B4R ! Today I want to test a vibration sensor (it's on a closed case yet)
The sensor signals when a sensor shake happens. It's a simple sensor (detected/not...
 

Attachments

  • upload_2019-10-25_11-37-52.png
    upload_2019-10-25_11-37-52.png
    162.9 KB · Views: 344
  • upload_2019-10-25_11-38-27.png
    upload_2019-10-25_11-38-27.png
    162.9 KB · Views: 327

[B4X] B4RSerializator - Send and receive objects instead of bytes

B4R v1.50 includes a new type named B4RSerializator (in rRandomAccessFile library).
B4RSerializator solves a difficult and common task. Sending messages with multiple fields to other platforms...
 

Attachments

  • B4RSerializator.bas
    4.9 KB · Views: 3,128
  • B4R_Server.zip
    1.1 KB · Views: 3,110
  • B4A_Client.zip
    10 KB · Views: 3,165
Last edited:

Inline C / C++

As in the other B4X tools you can embed C or C++ code in the project.

Example:
B4X:
Sub Process_Globals
   Public Serial1 As Serial
   Private Result, N1, N2 As Int 'ignore
End Sub

Private Sub...
 

How to get and parse Json from an Http server, inline C code

Hello,

Since a while i searched to do the same thing i did on an ESP01, but with B4R.
I did it 1st time in Arduino IDE o_O, see the video at bottom, that works well :)

I searched long time to...
 

Attachments

  • parseJson_InlineC_Domoticz.zip
    4.8 KB · Views: 422

Check blue tooth communication of your creations

Hi everyone,

Watching tutorials on YouTube I came across this application which allows you to check blue tooth communications. I suppose it will be handy to all of you...
 

Shrink your arduino project to the minimum

Hi everyone,

Last night I found this guy who explains everything simply and very detailed. Here he explains how to load our Arduino sketch directly (or indirectly) in an ATMega328P-PU...
 
Last edited:
Top