Oscillator 1-1,000,000 Hz
Using 16b TIMER 1 and inline C to get oscillating output at PIN 9 (Arduino Uno). the frequency can be set to 1Hz up to 1MHz, the output is set by division of the 16MHz crystal. When the frequency is power of 2 the output is accurate, otherwise the error can be up to 0.04%.
@moty22 · 2021-06-21
PWM with selection of frequency
Using inline C allows controlling TIMER 2 PWM output (analog output) to oscillate at selected frequencies of 61 Hz to 62,500 Hz.freq=1 to 7 select frequency, ana_out set the duty cycle and output at pin 11 (OSC2A) of Arduino Uno.
@moty22 · 2021-06-20
Using a PIR to rotate a servo [Emulating PIR opening/closing powered doors]
Using a PIR to rotate a servo [Emulating PIR opening/closing powered doors]
@Peter Simpson · 2021-05-23
Arduino NANO Serial AES-128KeyGen
As you know Arduino boards can be used for countless activities; in my case i use the NANO board as keygen for a software that i''m coding.
@MarcelloCSI · 2021-04-28
Uploading data to ThingSpeak using MQTT
Uploading data to ThingSpeak using MQTT
@Mark Read · 2021-03-21
Adafruit IO: Sending multiple data feeds with only one mqtt Publish message
Adafruit IO: Sending multiple data feeds with only one mqtt Publish message
@inakigarm · 2021-03-02
Returning value to B4R RunNative calls from c code
Returning value to B4R RunNative calls from c code
@Daestrum · 2021-02-20
GY-530 / VL53L0X Time of Flight (ToF) laser ranging sensor - Inline C
SubName: Using Time of Flight (ToF) laser sensor to measure distances. Description: A ToF laser ranger sensor is an Infrared (IR) distance measurement sensor, the module uses I2C Bus communications (mine is at 0x29) and can be powered by either a 3.3V or 5V power source. The ToF sensor can measure distances between 30mm and 2000mm (30cm to 2m) with an accuracy of ± 3% (apparently). This module can detect the ToF, or how long the emitted light has taken to bounce back to the sensor. Since it uses a very narrow light source, it is good for determining distance of only the surface directly in front of it. PLEASE NOTE: The internal laser emits 940nm wavelengths of non-visible light and does not harm the eyes, but if you use your phone camera you can see the light on your screen.
@Peter Simpson · 2021-02-04
12 bit analog output for ESP32 with MCP492X via SPI
12 bit analog output for ESP32 with MCP492X via SPI
@bussi04 · 2021-01-31
M5 Stick-C
M5StickC is a ESP32 development board for rapid prototying. Attached some examples how to use it with B4R.
@Michael1968 · 2020-12-09
Play tone in ESP8266.
Play tone in ESP8266.
@hatzisn · 2020-11-12
7 segment display [with dots]
7 segment display [with dots]
@derez · 2020-11-02
Setting the hostname of an ESP32
Setting the hostname of an ESP32
@KMatle · 2020-09-01
Random number between X and Y
Random number between X and Y
@tchart · 2020-08-26
Enhanced pushbutton handling
This small sketch shows how to handle pushbutton debouncing and automatic repetition.
@tigrot · 2020-07-15
ESP32 with built in OLED display connected to WiFi - Inline C extension method for BMP images
ESP32 with built in OLED display connected to WiFi - Inline C extension method for BMP images
@NoNickName · 2020-06-23
Day of week calculation
Day of week calculation, based on Zeller''s algorithm
@NoNickName · 2020-06-07
Using the second core on an ESP32
Get the most out of the ESP32 by running code in Core 0 as well as the default Core 1. Arduino runs all code in Core 1 and Core 0 is left idle. Use this code to utilize Core 0. Not sure how stable this is but its hasn''t given me any trouble yet!
@Tron71 · 2020-06-03
ModBus RTU
ModBus RTU
@OGmac · 2020-03-18
Tip: Getting rid of the excessive compiler logs - Arduino 1.8.10
There is a bug in Arduino v1.8.10 which causes debug output to be produced during compilation. You can disable it by editing: C:\Program Files (x86)\Arduino\arduino_debug.l4j.ini This requires administrative access.
@Erel · 2020-03-17
Firebase Push Messages (FCM)
This code uses rHttpUtils2 to send push messages. It is equivalent to the B4J/A/i code posted here: https://www.b4x.com/android/forum/t...s-firebase-cloud-messaging-fcm.67716/#content Notes: - #StackBufferSize should be set to 500+. - The title and body messages are not escaped. You will need to manually escape the messages if they include quotes.
@Erel · 2019-10-28
Base64 decoding
Base64 decoding
@Erel · 2019-09-08
RadioButton with ESP Server
RadioButton with ESP Server
@Hans- Joachim Krahe · 2019-07-17
See human readable Arduino running time
See human readable Arduino running time
@hatzisn · 2019-07-17
JSON Parsing
Two methods to help parse JSON strings
@Erel · 2019-07-07
Passive Buzzer playing Ludwig van Beethoven''s Fur Elise
Passive Buzzer playing Ludwig van Beethoven''s Fur Elise
@Johan Schoeman · 2019-06-29
SN74HC595N - my effort with this shi[f]t register
The SN74HC595N seem to be a very temperamental shi(f)t register. Took me hours to try and figure it out. Seems to have a lot to do with the timing when driving LED''s (sinking too much current if they are on for too long?). Well, this is my effort - the LED''s flicker on/off, one at a time, from LSB to MSB and then again from MSB to LSB.
@Johan Schoeman · 2019-05-26
reading smart meter smr5.0 p1 port
reading smart meter smr5.0 p1 port
@MbedAndroid · 2019-04-21
Base64 encode via Inline C
Base64 encode via Inline C
@KMatle · 2019-04-13
Read a Nunchuk using I2C with B4R an ESP8266
Nothing spectacular the code just reads and logs the joystick x & y axis, the 2 buttons (Z&C), the 3 axis accelerometer data, as well as the calibration data. It works on the OEMs and Knock Offs if you lower the clock speed as indicated. I just ported some Arduino Code to B4R from the website listed in the code.
@KiloBravo · 2019-04-13