Category: Library

In-depth discussions of (aspects of) some libraries

Replacing the Wire Library—Sometimes

The featured picture of this blog post is by user18526052 on Freepik.

The Wire library is the one that connects your Arduino to sensors and actuators that communicate using the I2C protocol. Unfortunately, this library has a lot of shortcomings, and often you want to replace it with a different I2C library. Replacing the Wire library on a per-sketch basis turns out to be more complicated than one would expect. In this blog post, I describe an easy way to accomplish that.

Continue reading

Calibrating Your AVR MCU

The featured picture is by OpenClipart-Vectors on Pixabay.

In building one’s own MCU board, one often does not use a crystal or resonator. Instead, the internal RC-oscillator is employed, which can be quite inaccurate. Similarly, if one wants to use the internal reference voltage to measure the supply voltage, it turns out that the reference voltage can deviate from its nominal value quite a lot. Both, the RC-oscillator and the internal reference voltage can be calibrated, though. In this blog post, I describe a simple method to calibrate both using only a UNO board and a multimeter employing the avrCalibrate library.

Continue reading

Is any Input Available?

The featured image of this post is by rawpixel.com – de.freepik.com

The SoftwareSerial class has the available() method, which returns the number of characters that have been already received but not yet read. This is very similar to what the standard Serial.available() method offers. There is an interesting difference, though. A call to SoftwareSerial.available() is significantly slower than a call to Serial.available(). We will look for the deeper reason for this strange behavior and I will show you three ways how to fix it.

EDIT: The problem will vanish with Arduino version 1.8.17

Continue reading

Copyright © 2024 Arduino Craft Corner

Theme by Anders NorenUp ↑