B4R Tutorials

Stepper Motor with swing and rotate

Here is some code to demonstrate using a single stepper motor, an Uno, the Adafruit Motor Shield and a three-way switch. The middle position of the switch is OFF. One side rotates the motor until...
 

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:

SSD1306 Progress Bars

Based on SSD1306 module, we can implement horizontal and vertical progress bars. These bars could be drawn at X1-Y1 to X2-Y2 like drawing rectangles, also we need to pass the full scale...
 

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: 588
Last edited:

SSD1306 Animated Image

Based on SSD1306 module, we can display animated images the same as displaying animated GIF on PC. The animated image is a byte array contains (n) number of frames(bitmap images) they all...
 

Attachments

  • bt_frames.zip
    793 bytes · Views: 326

Some code to write into and read from EEPROM on ESP8266

Hi,

My first tutorial.

I've been playing with code to do what the title says and I have come up with this.

It should be self explanatory.

It relies on the use of B4Rserializator.

B4X:
...
 

Solder ESP8266 ESP-12F to an adapter plate

So you have an ESP-12F and want to use it in a project, well I find that the best way for my home projects is to use an 12x adaptor plate. I have a number of ESP-12F projects running throughout my...
 

Simple example of how to have a TCP Server and make HTTP Client calls in same project

I thought I'd share this super simple example of creating a TCP Server and making very simple HTTP Client calls in same project. Typically most projects do one or the other and not both. Here...
 

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:

Show-Off your IoT boards ( uControler/shields )!!

There seem to be quite a few variants of the Arduino's Boards, So I thought, let's Show-Off our Boards and create a Listing, similar to the B4A devices Listing, so that when problems arises, we...
 

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:

SevSeg with inline C

This B4R project uses the SevSeg library via inline C to display characters on a 4 digit x 7 segment LED display (I am using a SMA420364L) - hard wired.

The inline C code via the...
 

Attachments

  • SevSeg.zip
    5.5 KB · Views: 408
  • b4rSevSegInline.zip
    2.5 KB · Views: 383
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: 454
  • datasheet.pdf
    297.8 KB · Views: 455

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

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: 958
Last edited:

Servo motor and Arduino

Thanks to @Erel and the new rservo library (Beta#7), we've access to servo motors.

Servos are a motor type that allows for precise control of angular or linear position, velocity and...
 
Last edited:

Serial oscilloscope

Last edited:

SD cards

The rSD library allows reading and writing to SD cards. The Ethernet shield as well as other shields include a SD slot.

The steps required to work with files:
1. Initialize a SD object. You need...
 

Attachments

  • B4J_PrepareCurrencyFile.zip
    2.8 KB · Views: 941
  • SD_Example.zip
    1.1 KB · Views: 1,165

RTC DS1302 Example

Hi,

this is an example of using the Real Time Clock DS1302 (from sunfounder).
There are two versions:
1. Manual: Set the time manual befor uploading. After uploading the time is...
 

Attachments

  • B4RHowToRTCDS1302.zip
    347.2 KB · Views: 1,144
Last edited:

RSA Encryption: Create keys, en-/decrypt, hash, sign/verify signature (clean code)

This example replaces my previous examples with cleaner inline C coding (I'm getting better :))using almost all variables from Globals. You can define the keysizes (eg. 2048 or 4096). It's fully...
 

Attachments

  • RSAOnly.zip
    3.4 KB · Views: 191
Top