We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [library]

A library is a file that can be included into the code to add new instructions by combining many existing instructions and creating one easy to use instruction to call.

Filter by
Sorted by
Tagged with
1
vote
2answers
125 views

Attach Interrupt with Library

I am trying to make a library for Arduino, which requires an interruption, but the problem is that when I try the attachInterrupt function inside my library, there's a problem about attachInterrupt is ...
1
vote
1answer
154 views

Trying to make sense of the coding style in Arduino libraries. (Particularly the Radiohead library)

I've been using the Arduino IDE for some time now, and I want to shift to coding for the bare AVR microcontroller. So I wanted to begin by porting required arduino libraries to C/C++. I started with ...
1
vote
4answers
3k views

Running a 7 pin OLED with 4 pins (I2C)

I have an OLED with this 7 pin pinout: I want to use an existing code i found that makes use of U8Glib. But in the example, use uses 4 pins to control the OLED via I2C. This is the pinout he uses: ...
1
vote
2answers
380 views

Interrupt handler in library

This is my first library so feel free to burn me and vote this down :D This is a library that provides me with Watchdog deep sleep on my ATtiny85 projects. In the test sketch I use the watchdog timer'...
1
vote
1answer
59 views

Creating a library

I created a simple library for formatting text output on the serial monitor. It has thee functions, one that creates carriage returns, one that sets the number of spaces between characters and the ...
1
vote
2answers
306 views

Is it possible to package a sketch with dependent libraries for cross-platform compatibility?

I have a complex sketch that I spent many weeks working on, which I am backing up frequently because I'm afraid of losing any of my progress. I'm wondering if it's common practice to make a self-...
1
vote
2answers
791 views

error: 'CLASS' does not name a type only when creating object inside another object

I'm trying to use Adafruit's LED Backpack library within a custom class. When I use the Adafruit library directly within a sketch, it compiles fine. When I use an example sketch provided with the ...
1
vote
2answers
66 views

Is it necessary to reduce the size of libraries?

For example RTClib library have codes for DS1307, DS3231, PCF8523 and softRTC. but I'm only using DS3231 and don't need the extra codes there to occupy my Arduino flash memory. Does Arduino IDE only "...
1
vote
2answers
99 views

What is causing this warning in Arduino IDE?

I'm using DS3231 module with rinkydink library and it is working just fine, however every time i want to compile the code Arduino IDE shows this warning: C:\Program Files (x86)\Arduino\libraries\...
1
vote
1answer
120 views

New code results in audio noise

I am working on a circuit that can record audio to an SD when a switch is HIGH and stop recording when the switch is LOW. I am using the TMRpcm library. I previously had an issue solved on these two ...
1
vote
2answers
77 views

Why is there no embedded c code in arduino libraries?

When I took a look at how the arduino libraries were coded I expected to see register names like I/O registers(PINx,DDRx,PORTx) and other such registers with values assigned to them but instead I saw ...
1
vote
1answer
1k views

How to install your own library with Arduino IDE 1.8.5?

I'm struggling a bit with Arduino language + its IDE not being 100% real C++. I wrote my own I2C library for a sensor but can't get the IDE's compiler to recognise it. I'm using Ubuntu 18.04. I get ...
1
vote
1answer
44 views

Cannot load anything from library

So I installed libraries through the Arduino interface (Sketch > Include Library > Manage Library). Then I check: C:\Users\username\OneDrive\Documents\Arduino\Libraries, and I confirm the new ...
1
vote
1answer
387 views

Error using Crypto Library for Arduino: Speck

I'm trying to encrypt a string in my Arduino Uno using the following library: https://github.com/rweather/arduinolibs/tree/master/libraries/Crypto And I'm getting this error: In function 'void ...
1
vote
1answer
1k views

ESP 8266-01 Library

I've just bought two of these wifi modules in the hope of setting up some sort of sensor network. Please could somebody recommend a good library for the arduino. Cheers
1
vote
2answers
81 views

Library using another library

I'm writing library for smart home arduino DIY project. i want to use another library(not written by me). here is the code: boiler.cpp #include "Boiler.h" Boiler::Boiler(int pin) { _pin = pin;...
1
vote
1answer
376 views

RadioHead and DallasTemperature error

The RadioHead library only runs on a very old core for the ATtiny85. It sends data but I would like to send something useful. The problem is I cannot read any sensors using this core. And on any other ...
1
vote
2answers
2k views

arduino not loading library

I am receiving a compilation error from #include <HX711.h> The error is fatal error: HX711.h: No such file or directory However, C:\Users\user\Documents\Arduino\libraries\HX711 is there ...
1
vote
1answer
275 views

Missing Libraries make no sense

I've never much issue importing a library to my master sketchbook location, restarting Arduino, then using the library examples. Today is a different story: I'm loading RCLib which is part of this ...
1
vote
1answer
1k views

Where can I find magnetic declination lookup table?

Is there a way to get approximate value of magnetic declination from GPS coordinates? My Arduino-based device has a Magnetometer and a GPS, and uses magnetic declination in calculations. I would like ...
1
vote
1answer
1k views

Create a library without a class?

I'd like to know if it's possible to create a library for Arduino that does not contain a class, just functions. I know how to create a library with a class, but I'd like to create a library of ...
1
vote
1answer
165 views

Cannot include .h files back one directory

I am working on a project with multiple arduinos. I want my folder structure to be as follows: / libs/ someSharedFile.h arduino1/ arduino1.ino arduino2/ arduino2.ino When I include ...
1
vote
3answers
1k views

Use only one pin as serial output/input with arduino

I'm looking for a way to use Arduino UNO's as serial outputs or input "individually", I don want to have an RX pin for each TX pin. I know the library SoftwareSerial, but I'm not sure if it is posible ...
1
vote
2answers
908 views

How to avoid delays in the loop() function?

vI have this functions in my loop() and it publishes temperature reading to Ubidots(an IoT cloud service) using the #include library but it seems it returns a boolean and so the loop is delayed until ...
1
vote
1answer
1k views

Basic usage of Nick Gammon's Regexp library

I am using the following code modified from the examples. I get the count of matches but the actual value is not displayed #include <Regexp.h> void setup() { Serial.begin(115200); ...
1
vote
2answers
6k views

Problems with Draw Loop using u8glib

I am using an Arduino Mega and a 12864ZW LCD with the u8glib library and the following code to draw to the LCD: U8GLIB_ST7920_128X64 Display(LCD_E_PIN, LCD_RW_PIN, LCD_RS_PIN, U8G_PIN_NONE); void ...
1
vote
1answer
519 views

Why can't I include a library in another one?

I am trying to create a new library that uses another existing library. The original library declares a way to create an object called Multiserial that can be created in the main file and the program ...
1
vote
1answer
2k views

Can I access individual pixels on my 16x2 LCD display

I have a generic 16x2 LCD display connected to my Arduino. I can use the standard LCD library to display characters, but are there way to turn on and of individual pixels?
1
vote
1answer
2k views

lcd.print and 2D arrays

Click here to see my program running I have created a 2D array (see my full code below), and each row contains one state of a battery here is a schematic : row [0] : "▯▢▢▷" // this row represents ...
1
vote
1answer
80 views

FastLED library: How can I adjust the brightness of a single pixel on an absolute scale?

I'm using the FastLED library to control a digital RGB LED strip. While this library seems very comprehensive in capability and ease of use, I do not yet see a way to simply set the brightness value ...
1
vote
1answer
31 views

fail to pass a value in constructor

I'm making a JSON lib dedicated for my own needs, based on ArduinoJSON v6. I try to define StaticJsonDocument<_docSize> doc in a parametric way but I get this error and I cant find the reason ...
1
vote
2answers
569 views

Where should a modified “pins_arduino.h” be stored for Arduino IDE compile?

Our PCB uses an ATmega2560 chip and uses most of the pins, including some that are not defined in the standard pins_arduino.h module, since that module only provides for the pins that are brought out ...
1
vote
1answer
443 views

How to avoid calling multiple times Wire.begin() in libraries?

it's all in the title ; I'm developping a library and use *TwoWire pointers in this library ; but I am using an external library that calls Wire.begin(). I've seen something about TWCR register in ...
1
vote
1answer
659 views

Error: “undefined reference to …” when calling non-void class' functions from within class

I haven't used an Arduino for anything as complicated as this project before (single sketch projects so far), and am struggling getting my code to compile now that I'm creating my own libraries for ...
1
vote
3answers
11k views

TimerOne.h library for nodeMCU

Following is the code I found in Arduino example files. It compiled fine on Arduino UNO. But there was an error when I tried to compile it for nodeMCU 1.0(ESP 12E Module). #include <TimerOne.h> ...
1
vote
1answer
231 views

Wireless Shield Not being detected w/ Arduino Uno R3

Wireless Shield is not being detected by arduino, not MAC address is displaying. Not sure what to try next, there is nothing noticeably wrong with the shield at first glance. Green LED under status ...
1
vote
1answer
333 views

Arduino Due unable to access library [closed]

I am unable to run code on Arduino Due that I earlier ran on an Arduino Uno. The error indicates it is unable to recognize the library. Could this library access problem be due to difference of the ...
1
vote
2answers
7k views

incompatible types in assignment of 'int*' to 'int [0]'

I was coding a class for "a kind of gun". I have this code for the classes: Gun.h: #ifndef Gun_h #define Gun_h #include "Arduino.h" class Gun { public: Gun(String identifier, String name, int ...
1
vote
1answer
343 views

HMC5883L - Tilt compensation without Accelerometer

Trying to get an HMC5883L to compensate for being installed in 90 degrees. Doesn't seem to me that it'll need too complex math or accelerometer. But I have no idea how to do the compensation for it. ...
1
vote
1answer
11k views

Arduino Uno Sensor DHT11 Failed to read from DHT sensor

I get this error every time. I used the DHT tester file from this library. Which gives me an error. And then I realized that in my code Arduino recognizes only the readTemperature function, not ...
1
vote
1answer
308 views

Nano + ESP8266 control pins with REST API

I connected and flashed successfully an ESP8266 module to a Nano. Now I want to control pins values with a REST API, but all the libraries I found are for using standalone ESP8266 modules (without ...
1
vote
1answer
469 views

SSD1306 OLED LCD Library Errors

Recently i bought an "Serial 128X64 OLED LCD Display SSD1306". I searched for available libraries and tried to find the best one to use before actually experimenting with this device. I came across ...
1
vote
1answer
23k views

Error: “invalid use of non-static member function” while calling a function from my own class-method

I'm having a bad time trying to call a correctly-working expression (ultra[currentSensor].ping_timer(echoCheck)) from an own class method (myclass::run) instead of from void loop(). I'm getting the ...
1
vote
1answer
73 views

Mains-Frequency Clock Library

I have an arduino thing, and the hardware I plan to connect to it (a triac zero-crossing based dimmer) provides a synchronization signal from the mains power phase it connects to. Main power does of ...
1
vote
2answers
7k views

Global variables use to much space in the dynamic memory

I use two simple libraries (see 1, 2) I found online for my code on the Arduino Uno, unfortunately I also use ROS and all those libraries take away to much space, when I compile my code I get this ...
1
vote
1answer
127 views

How to use setModemRegisters in RF24

The below picture is the introduction of setModemRegisters . First: What is the mean of ModemConfig* config? I mean: how to write the parameter. Maybe just give a example, and it will be better if it'...
1
vote
1answer
102 views

RH_RF24_MAX_MESSAGE_LEN in RH_RF24.h

I use RH_RF24.h to control Si4463, and realize some simple communication between two Si4463 . But I don't know the mean of RH_RF24_MAX_MESSAGE_LEN in this example. RH_RF24_MAX_MESSAGE_LEN is a ...
1
vote
1answer
209 views

MG2639 CELL AND GPS LIBRARIES

I'm using a MG2639 Cell Module with the SMS and GPS functionality. I have a sketch that sends through SMS the location of the arduino UNO. This is my code: #include <SoftwareSerial.h> //to ...
1
vote
2answers
505 views

Debugging with an ATtiny?

I have an ATtiny hooked up to two line scan modules. I'm sending digital signals to the line scan modules then receiving the analog output and storing it in an array. I have an if statement that will ...
1
vote
1answer
54 views

Any way to not explicitly include dependent libraries?

When I am including the Adafruit_BMP280 library, Arduino IDE 1.7.10 complains that it wants all dependent libraries included: Adafruit_Sensors.h Wire.h SPI.h Isn't it possible to circumvent that? ...