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
0
votes
0answers
39 views

Arduino Lib doesn't recognize String type

I use the following code snippet in a library I wrote: int MyClass::Send(MyMessage* message) { String rev = func(); // Do Work } And in a different library I wrote: String func(){ ...
0
votes
0answers
20 views

Having problems compiling this code for NRF24l01 on stm8s103f3p6

It said it has mutiple libraries were found for "nRF24L01.h" but i check the Ardurino libraries I can only found one. And it work fine if I compile it to Arduino uno. //Include Libraries #include <...
0
votes
2answers
35 views

How do I segment Arduino program when line count is so large that code maintenance is difficult?

I'm looking for the Arduino/C++ equivalent of COBOL's 'copy' statement. I'm working on a program that is approaching 600 lines of code in the TopLevel.cpp source file. This is hard to manage ...
0
votes
1answer
18 views

Protecting variables and functions within a library that has no class

If you want to have functions within a library that only the library itself should be able to use or variables that shouldn't be accessed from outside, you usually make them private by writing this in ...
0
votes
1answer
24 views

TimerOne Hanging

For the following program. Compiles and runs. I start the Serial Monitor (shown following code) and it asks me to input the Blink Rate. This runs in setup. Then it enters the loop and prints to the ...
0
votes
1answer
24 views

How to Use Function Code 6 Modbus RTU library

I'm trying to communicate with a temperature controller using Modbus RTU. I used this Arduino library. I was able to read PV(current temperature value) using below code. It uses Function code 4. I ...
0
votes
1answer
19 views

Initalizing library object in own library

EDIT: @Juraj fixed the Issue, changes at the end of the post I am developing an application to program OneWire ID Chips. I am using the OneWire library (https://github.com/PaulStoffregen/OneWire) and ...
0
votes
1answer
48 views

millis() function works with inline code and gives output but when creating own library it doesn't works

I am creating library for GPS to use in my project. I am using Adafruit GPS and its library to create my own library in which I am using millis() function to display the GPS Location after 1 minute (...
0
votes
1answer
36 views

Creating an array with the length coming from a library

When creating an array like in the sketch #include <Lib.h> int myArray[Lib::len]; void setup() {} void loop() {} the variable len must be an integer constant that is known at compile time. ...
0
votes
1answer
33 views

Error: invalid application of 'sizeof' to incomplete type 'int []' when trying to compute the size of an array in a library

I have created a library that contains an array. This is the .h file: class Lib { public: static int arr[]; }; And this is the .cpp file: #include "Lib.h" int Lib::arr[] = {0, 1, 2, 3}; ...
-1
votes
0answers
42 views

Adding oled library stops sound from working?

my code is using keypad library and oled display and piezo element. Without the oled code added everything works just fine. as soon as I add code for that, sound stops working. doesn't even call the ...
0
votes
2answers
28 views

Including keypad library removes sound from my piezo element

I am using the keypad library to include keypad and input numbers. when a specific number is entered a sound must be made. However when I input using the serial monitor , sound is working. But when I ...
4
votes
2answers
91 views

How to document a custom library in Arduino

I have created my own library and it is working flawlessly. Now I want to add some documentation to it that the Arduino IDE can understand. For the functions from the Arduino IDE itself like delay(ms)...
1
vote
0answers
32 views

Use Arduino Libraries in PlatformIO?

I'd like to use Arduino libraries installed in C:\Users\Username\Documents\Arduino\libraries in a PlatformIO project. Is it possible? if so, how?
0
votes
1answer
40 views

How to use existing (non-arduino-specific) library with subfolders in Arduino IDE?

I have a generic c++ library that i'd like to use in an arduino project without making changes to the library code. The library contains subfolders and files in the library include other files of the ...
0
votes
1answer
20 views

Calling functions from an array of pointers in a library causes 'undefined reference to' error

I am trying to create a library, where I have an array of pointers to functions in it. This array is used by other functions in the library. This is the code of the header file: class Lib { public: ...
1
vote
1answer
123 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 ...
0
votes
2answers
44 views

How to set “IPAddress ip” using a variable?

Created a "variableInput.h" file for editing variables in one place; instead of searching multiple lines of code, to find lines needing editing. // variableInput.h // // User defineable ...
0
votes
1answer
299 views

Library compilation error

Need help for this Tutorial. I tried to compile the code, but I'm getting compiling error. I tried to ask on that forum too but got no answer, the error is: In file included from C:\Program Files (...
0
votes
0answers
22 views

Check if the fingerprint exists and enroll with it? Adafruit_Fingerprint.h

I need to verify a fingerprint before being registered, but I have to put the finger 3 times on the finger sensor, which I prefer to do it just twice. The verification is ok, but I don't understand ...
0
votes
0answers
37 views

IRremote library not compiling for Sparkfun RedBoard Artemis

I have an IR Receiver hooked up to digital pin 10 on my Sparkfun RedBoard Artemis and I want to decode IR signals coming from a TV remote. I have the following code: #include <IRremote.h> int ...
2
votes
4answers
85 views

Why do most arduino function return a -1 instead of a 0

Many arduino functions return -1 if something 'fails'. Serial.read for example returns -1 or the infamous ÿ when this function is called while the serial buffer is empty. As embedded C progammer, I ...
0
votes
1answer
199 views

Wiring ESP8266 and PN532

I'm trying the Android Hce example in this PN532 library. I can't find how to set SDA and SCL address in the code, so I tried connecting them in CLK and SD0 pins. The serial monitor gives me "Didn't ...
0
votes
0answers
47 views

Fonts/Org_01.h: No such file or directory

I have written one Arduino code for working with tft lcd 2.4 and in it i used <Fonts/Org_01.h> new font ,It was working in my Win8 OS but now in Linux OS i have installed new Arduino in my ...
0
votes
1answer
105 views

How to scale a bitmap (uint8_t array) in Arduino?

So I have a project where I send text to an Arduino, which is then printed out as a QR code on a thermal printer that can take a bitmap image with a given width and height. Is there a way I can "...
0
votes
0answers
66 views

Using a 122x32 LCD display with u8g2

I recovered a 122x32 graphic LCD display, its reference is NMTB-S000087FYHSAY-04. Here are some pics It was retrieved from a completely rusted object, but the screen seems to work. It is a 122x32 ...
0
votes
1answer
44 views

SPIMemory does not write always correctly

I'm using a WinBond 25Q128FVIQ (Flash 128 mbit, 3.3V) in combination with the Marzogh SpiMemory library on my Arduino Nano (also 3.3V). After using the default example, I found out what was read, did ...
0
votes
1answer
146 views

Error: “'lcd' does not name a type” using LiquidCrystal library

I'm following an online Arduino tutorial/course and trying to make a simple moving character on an LCD screen, but for some reason I get the following error: "error: 'lcd' does not name a type". I'm ...
0
votes
0answers
119 views

Using the Broadcom AFBR-S50 with Arduino

I'm trying to interface with a Broadcom AFBR-S50MV85G ToF sensor over SPI using an Arduino, which is complicated by the fact that the provided library and reference application is written for Cortex ...
0
votes
0answers
73 views

src folder in sketch structure and include library from subfolder

My Arduino/PlatformIO libraries folder libraries └── cleaner_robot └── TB6612_Dual ├── tb6612_dual.h └── tb6612_dual.cpp I used this code to innclude it: #include <...
1
vote
2answers
68 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 "...
0
votes
1answer
353 views

Error when HX711_Arduino_Library installed

First I'm getting this error #include no such directory. Then HX711_Arduino_Library installed. Now getting following errors: Arduino: 1.8.9 (Windows 7), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, ...
0
votes
1answer
53 views

Modular Coding - What types of code portions to convert into library files? Rationale and methods?

I'm working on documentation and combining 2 pieces of code for testing parts of a larger project. I'm supposed to comment and make the code very clear to people who will use it later and make sure ...
0
votes
1answer
41 views

Is there a simple HTTP(S) library that doesn't rely on WiFi?

I'm trying to implement a Mobile Network (only) for the ESP32 using Arduino IDE. So to be able to connect to website up/download files etc. I need to be able to handle various HTTP PUT/GET/POST ...
2
votes
1answer
160 views

Two libraries collide. Ambiguous functions/variables?

I get several errors once I try to include these two libraries: error: expected unqualified-id before '{' token #define DEBUG_PRINTLN(...) {} #include <DHT.h> #include <DGS.h> ...
0
votes
0answers
43 views

How can remove the WiFi/Bluetooth libraries when compiling the firmware using the Arduino IDE?

I have an ESP32-D0WDQ6, which is part of the ESPIRIT freematics development kit. The processor is a 2-core Tensilica LX6 and the module has 520 kB SRAM + 4 MB external on-module flash. It also has the ...
0
votes
0answers
41 views

Arduino core libraries

We have worked with a company to design a custom board based on the Arduino Zero and have also had them do some programming for us. In doing so, they have had to modify the following Arduino core ...
0
votes
1answer
43 views

Libraries not included correctly

I stumbled upon the following unexpected behaviour and am curious about its cause. header.h: #include <Time.h> [...] main.ino: #include "header.h" #include <Time.h> [...] My code is ...
-1
votes
3answers
111 views

How to prevent modify library of arduino?

For some reasons of security, I created library for everybody to use, but I don't want people change my library, cause it make device not work. I search around but still not working. Do I need to set ...
0
votes
1answer
44 views

RTClib library the second, second

I'm using RTClib for my DS3231 module, the problem is the library is displaying the second without zero behind it: 22:1:1 and when i print the time on my 16x2 LCD time is displaying like this: 22:...
1
vote
2answers
114 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
votes
1answer
44 views

Please help me fix this error:expected unqualified-id before 'if'|Arduino [closed]

#define inA1 4 #define inA2 5 // 4,5 DC 1 #define inB1 6 #define inB2 7 // 6,7 DC 2 #define inC1 8 // Buzz #define inL1 2 #define inL2 12 #define inL3 3 #define inL4 13 // Den led byte bluetoothByte ...
0
votes
1answer
321 views

Include guards vs #pragma once [closed]

Is there any particular reason why #pragma once doesn't seem to be used in Arduino code? Is this just because it's not a well-known feature, or is there some overriding reason to use #ifndef XXX_H/#...
0
votes
1answer
64 views

Arduino IDE upload error

I've recently been trying to make program using IRremote(library) in my Arduino IDE(v1.8.9), but whenever I hit the upload button this error message is returned Sketch uses 7514 bytes (23%) of ...
1
vote
1answer
27 views

Bit Number to Byte Value conversion (AVR Docs)

I have hard time to understand what this doc tells me: https://www.microchip.com/webdoc/AVRLibcReferenceManual/FAQ_1faq_use_bv.html I has a macro called _BV that convert a bit number (usually ...
0
votes
1answer
102 views

Unresolved reference to public function from library

I have three libraries that I've written and I'm trying to use. They're stored as follows Documents ├── Some/Path/To/Folder │ └── firmware.ino └── Arduino └── libraries ├── error ...
0
votes
0answers
32 views

How can if resolve this conflict between matrix keypad library and neopixel library?

I'm trying to use a 4x3 matrix keypad as a user interface to control parameters of a Neopixel strip control program. I'm using Adafruit's Neopixel library and This Keypad library. Both work fine on ...
1
vote
0answers
79 views

UDP behavior different for STM32

I'm facing a weird situation, where the UDP behavior seems different in STM32 porting (stm32duino). Short question Besides port and address, what are the other parameters that characterize the UDP ...
0
votes
2answers
44 views

Questions about HMC5883L library

I'm studying the structures of libraries currently. I want to learn how good programmers write code, what are the strategies they follow, the art the programmer followed to develop the library. And ...
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 ...