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
2answers
905 views

Replace Wire library with TinyWireM

I want to integrate Pololu's vl53l0x Time of Flight distance sensor into a project of mine. They created a library to interface with the vl53l0x over I2C, which works great on my Uno. The only problem ...
3
votes
2answers
149 views

Servo Driven Through Custom Library Not working Properly

I'm a little new to Arduino, but not to programming or electronics in general. I'm working on a library that will be more fleshed out later, but I'm having issues getting the basics working properly. ...
3
votes
1answer
257 views

Crosspack instead of Arduino IDE, how to include Arduino.h

I quit using the Arduino IDE, instead I am now using Crosspack via the command line on my Mac. It is working totally fine. I use "make" to compile it, "make flash" to upload it to the Arduino. This ...
3
votes
1answer
328 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
322 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
305 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
760 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
150 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
1answer
99 views

Use ISRs inside a library more elegantly

At the moment I try to make a library which uses attachInterrupt(?,?,RISING) to read a sensor. The article of Nick Gammon on Calling an ISR from a class helped me a lot, but his "Glue routines" get ...
2
votes
2answers
1k 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
183 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
167 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
254 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
825 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
3answers
10k 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

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 ...
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
5k 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
243 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
2answers
4k 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
397 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
339 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
1k 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
2answers
9k 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 ...
2
votes
1answer
197 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
2k 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
916 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
2answers
4k views

Why does the RCSwitch.available return false?

I am trying to use this example code from the RCSwitch library: /* Simple example for receiving https://github.com/sui77/rc-switch */ #include <RCSwitch.h> RCSwitch mySwitch = RCSwitch();...
2
votes
1answer
146 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
249 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
85 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
3answers
9k 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
587 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
58 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
819 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
1answer
134 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
315 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
7k 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
455 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
2
3 4 5
9