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
3
votes
1answer
326 views

NodeJS (Galileo-IO) + Arduino sensor library

I've done some basic apps with NodeJS firmata where I can connect to my Arduino Uno and do the basics like reading a pin or doing a servo write. I'd like to go further and play with some different ...
3
votes
1answer
299 views

Single #include pulls in all libraries

I am tracking down the memory usage of an Arduino-like project I am working on (not a real Arduino, but has same microcontroller and it uses the Arduino build environment, version 1.6.8). I have some ...
3
votes
2answers
297 views

CC3000 Wifi: Enable Debug

How do I enable debugging using Adafruit CC3000? I am using the Adafruit_CC3000_Library. I've followed the WebClient.ino example sketch. I'm able to make 300 to 400 HTTP requests, but eventually ...
3
votes
1answer
3k views

TCCR1A and TCCR2A on Leonardo

I'm trying to use the TTS library for Arduino on an Arduino Micro board, which is based on the Leonardo. When I try to compile my sketch I get some errors; /libraries/TTS/TTS.cpp: In function 'void ...
2
votes
2answers
545 views

Arduino Libraries: Declaring variables as public?

How come I never see any Arduino Library expose some of it's internal variables as public in the header file? I only see functions which are declared as public, while every variable is declared ...
2
votes
3answers
143 views

How can my library source code instantiate an object from another library?

I'm having trouble explaining my issue. What I'm doing is creating a library to work easily with the RFID reader/writer RC522 module. I need to create an object of the library MFRC522 in my .cpp file ...
2
votes
2answers
12k views

Making my own libraries

Does anyone know of a site or book where you can learn how to create, or for first reed, libraries. Because I think the libraries I use are sometimes unnecessary complicated, or have similar features, ...
2
votes
2answers
888 views

Creating a library of C++ classes for Arduino; How to #include “Arduino.h”, “WProgram.h”?

I've written 6 C++ classes on the CLion IDE to be used on Arduino. One of these classes uses a C++ library called "Adafruit_PWMServoDriver.cpp" provided by Adafruit to use the PWM driver they sell. I'...
2
votes
2answers
2k views

Why the command noDisplay() clear all LCD screen?

i want to preserve video information for long time without communicating with arduino on lcd 1602, i'm tryng to use the command of liquidCrystal library noDisplay() but when i use it,this clear all ...
2
votes
1answer
10k views

Error saying an included library is not

The IDE tells me the included library isn't? I tried restarting the IDE and my computer but it doesn't work. The other libraries work fine it's only with Keyboard that it fails. My code: #include &...
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 ...
2
votes
1answer
159 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> ...
2
votes
2answers
217 views

How to determine the source of constants in libraries?

Preamble: I am trying to figure out how to program and use the timers in the Feather M0 using the Arduino IDE. I have seen a number of examples published, but I'm not one to just blindly copy some ...
2
votes
1answer
636 views

Error: `nullptr` was not declared in this scope. Arduino IDE

I try to use this ArduinoThread library. In the Arduino I go Sketch->Import Library->ArduinoThread. After that I have the following line in the beginning of the sketch: #include <ThreadController....
2
votes
2answers
862 views

Usage of Crypto Library (Speck)

I really want to understand how can I use this library for my purposes. I'm trying to encrypt a message that comes through the serial port of the Arduino, and send it through another serial port. But ...
2
votes
3answers
8k views

Digispark / DigiKeyboard change keyboard layout

I'm trying to use the Digispark as a Rubber Ducky but the Digispark is only usable with the US laylout. German keyboard layout is QWERTZ. Some keys can be changed, like y and z, but if there are [ or ]...
2
votes
1answer
2k views

How to transmit string data using the rc-switch library?

I am using the rc-switch library for sending and receiving data. In rcswitch library, there is no method to send string data. I am using below method to send the string message in char buffer. ...
2
votes
2answers
4k views

multiple definition of local variable in linking

I am trying to make my own library and it uses some local variables with the same name as some variables in ino. Compiler complains about it. I stripped it to (nonsence but simple) example mylib.h: #...
2
votes
1answer
211 views

Arduino library not working, can't find header

I have fair experience with C/C++ so I decided to have a go at writing my first simple Arduino library. I wrote the code which seems to be fine to me except that it keeps complaining about the header ...
2
votes
1answer
10k views

Multiple definition of “…” Compiler Error

I am creating a simple library to test how multiple files in an Arduino program works. I have three files. MotorController.ino: #include <motor.h> void setup() { motorInitialize(); } void ...
2
votes
2answers
3k views

Undefined reference in Eclipse of .h and .cpp files

I'm trying to create a linked list for use on the Arduino, in the Eclipse IDE with the Arduino/Sloeber plugin. The linked list is written in a .h and .cpp file, and included locally in the project. ...
2
votes
1answer
324 views

Arduino library making

I make my own library for arduino. The file structure is like below. AAA - README.md - examples - A - A.ino - B - B.ino - AAA.h - BBB.h - CCC.h - BBB.cpp - CCC....
2
votes
1answer
3k views

Can't compile my library because “String does not name a type”

I am writing a small library to move some code out of the arduino sketch and make it reusable. Problem is that it does not compile since "String does not name a type". This is my code (reduced): ...
2
votes
1answer
1k views

How to detect if more than one button was pressed

I am designing a turn signal bicycle blinker using two pushbuttons as input, one for each side, with a corresponding light for each button. The idea is this: Pressing one side makes same side start ...
2
votes
1answer
1k views

Custom Arduino library problem

I have made my custom serial(UART) library. So I made uart.h and uart.cpp files as following. uart.h #ifndef UART_H #define UART_H #include <avr/io.h> #include <stdlib.h> //creating ...
2
votes
1answer
329 views

XBee, external libraries and passing structures as arguments

I have very weird problem with a library I am creating. The library will be used to communicate between Arduino modules using XBee Series 1 modules. Library is very simple wrapper library around ...
2
votes
1answer
564 views

I need help with U8GLIB library

I have a project which uses a 128x64 oled display. I have to use the U8GLIB as the available displays change from SSD1306 to SSH1106 depending on when you buy it which that library covers both ...
2
votes
2answers
4k views

ATTiny85 and DHT11 - Sensor always returning 0

Good day. I am making a small weather station using ATTiny85, DHT11, and an OLED display. There are many, many tutorials that explain how this works, and various libraries that show you how to get ...
2
votes
1answer
177 views

Is there a counter library in Arduino?

I'm looking for a counter that can be incremented and will overflow with predictable behavior, preferably reset to 0 on overflow. I've tried using integers for counting but I'm getting weird overflow ...
2
votes
2answers
1k views

How do I use interrupt service routines inside libraries and classes?

I'm trying to have a millis() timer run to emulate a hardware timer inside a library, but I'm having issues compiling the code. I want the callback (pseudo ISR) to be part of the class, and not use ...
2
votes
1answer
1k views

Adafruit_GFX setRotation not working when called from within a class

Using an ILI9341. I'm trying to set the rotation from within a class, but it's not working. The code is very straight forward. If I rotate in the class, the setRotation code does not work but the ...
2
votes
2answers
870 views

Example code and documentation on using Firmata communication in native Java

I have been trying for some time to get documentation on using Java and a Firmata client library for the communication between a PC and an Arduino. Please note I want to use Java only, i.e., not ...
2
votes
1answer
127 views

Using PBC library on Arduino

I want to know if there is a way to install/use the PBC library on Arduino UNO. I want to implement some cryptographic primitives using PBC library. Thank you.
2
votes
1answer
243 views

Initialize a “Matrix” object in my own library?

So, I'm trying to make a custom library to drive a 8x8 Bi-Color LED Matrix from 2 MAX7219's that incorporates two "Matrix" objects from the "Matrix" library and I cannot, for the life of me, figure ...
2
votes
1answer
63 views

Specific values not showing when using a numeric keypad

I have attached a 3x4 keypad to my Arduino Leonardo as an input method. Whenever I press the buttons, the majority of the keys work but specific ones don't. Here's my code, I've set it up to beep a ...
2
votes
1answer
274 views

FFT library for Arduino 101?

I am currently trying to get a real-time FFT working for a project on an Arduino 101 which uses the Intel Curie chip. All the FFT libraries (if any) seem to be for the Arduino Uno and architecture ...
2
votes
3answers
8k views

Arduino IDE doesn't find header file

I'm trying to start with the SainSmart 4x20 serial LCD, and copied the library to the Arduino library: So LiquidCrystal_I2C.h is included. But when I try to compile an example sketch it says ...
1
vote
2answers
499 views

How to write a library that support both HW and SW Serial communication and allow user to chose which one to use?

I'm working on a library for Arduino/ESP8266/Teensy that use serial to send AT commands. I want to make it as customizable as possible, so I avoided to hardcode the serial and I ask for a reference in ...
1
vote
3answers
56 views

Guideline in library creation

According to this example, creation of an Arduino library is quite understandable. But a few things I would like ask (mostly regarding to what to be defined where) when a library is not that simple: ...
1
vote
1answer
699 views

Ubuntu class string has no member remove

I am running some code that works fine on my windows system using the .remove method. On Ubuntu 16.04 I get the following errror: error: ‘class String’ has no member named ‘remove’ To see if it ...
1
vote
1answer
2k views

Pass class's public function as an argument to external command

I am trying to write a library for encoders. main.ino: #include <./Encoders.h> Encoders encoders(); void setup(){ Serial.begin(9600); } void loop(){ Serial.print(""); ...
1
vote
2answers
1k views

How would I include Arduino libraries using AVR-gcc without the IDE?

I am writing my own code for the Arduino Uno. I compile my code with AVR-gcc, and then upload it with AVRdude. I am not using the Arduino software, but I do have it installed and working on my PC. I ...
1
vote
1answer
133 views

How can I include examples in library?

I have written a library for Arduino, my_library, consisting of my_library.h and my_library.cpp, both included in my_library folder. Actually the library is recognized from IDE Arduino and works fine. ...
1
vote
4answers
2k views

Can I prevent the Stepper library from holding the motor?

I'm using the Stepper library to control a single stepper motor. When the Arduino is not running the motor it is holding the motor shaft in place. For my application, this is very wasteful and puts ...
1
vote
2answers
294 views

Convert library from using bitbanging to hardware SPI

I'm using a MCP3008 8ch 10bit ADC to expand the Analog Inputs for the project I'm working on. The only library I can find for it is here the library is ported from Adafruit's Raspberry Pi library here....
1
vote
2answers
6k views

Exit status 1 expected primary-expression before ']' Arduino

Here's the whole error: Arduino: 1.6.7 (Windows 7), Board: "Arduino/Genuino Uno" *\readMifare\readMifare.ino: In function 'void loop()': readMifare:113: error: expected primary-expression before ...
1
vote
2answers
443 views

Existence of a non blocking and task yield framework for Arduino programming

I've been playing around with Arduino and understand that the standard runtime provides a single thread essentially. I was wondering if it is possible to write a thin layer (library) that allows one ...
1
vote
1answer
2k views

Arduino error message that I don't understand

I downloaded Arduino code from this: https://github.com/BabyWrassler/MissionControl/ Github, and got the error message below. It is designed to work with a Raspberry Pi, and I installed the two ...
1
vote
1answer
25 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 ...
1
vote
1answer
187 views

Standard Practice for including custom library in examples folder

I have created my custom library with examples folder in them. The main header file is ABC_Node.h. I am referring the structure of Adafruit libraries for Arduino and in some repos under the examples ...