B4R Tutorials

Visualizing MPU6050 Accelerometer and Gyroscope - Pitch, Roll and Yaw with inline C and Processing

It is based on this tutorial. Nano programmed via B4R and visualizing the data from the MPU6050 with Processing -
See this posting for basic setup

B4R code:...
 

Attachments

  • mpu6050.zip
    983 bytes · Views: 617
  • b4rMPU6050InlineC.b4r.zip
    2.8 KB · Views: 594

Burn bootloader to ATMega328P-PU with an Arduino Uno

This is by 99% a tutorial and by 1% a question. The file in the link contains some notes for me I devised from a lot of tutorials on how to burn a bootloader to a ATMEGA328P-PU wired on a...
 
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:

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,835
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: 574
  • sketch_200215a.zip
    970 bytes · Views: 586
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,526

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,294
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: 605
  • datasheet.pdf
    297.8 KB · Views: 647
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: 557
  • datasheet.pdf
    297.8 KB · Views: 556

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

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: 504
  • LEDStrip_B4R.zip
    11.3 KB · Views: 497
  • LEDStrip - Metamucil Jar.jpg
    LEDStrip - Metamucil Jar.jpg
    358.5 KB · Views: 561
  • LEDStrip - Breadboard.jpg
    LEDStrip - Breadboard.jpg
    272.8 KB · Views: 532
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: 503

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

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: 410
  • upload_2019-10-25_11-38-27.png
    upload_2019-10-25_11-38-27.png
    162.9 KB · Views: 380

[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,282
  • B4R_Server.zip
    1.1 KB · Views: 3,256
  • B4A_Client.zip
    10 KB · Views: 3,301
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...
 
Top