Programmable-Air / Code

Arduino library for Programmable-Air
https://programmable-air.com
MIT License
48 stars 11 forks source link

How to include NeoPixel library in ProgrammableAir library instead of in each example? #12

Open tinkrmind opened 5 years ago

tinkrmind commented 5 years ago

The hardware has three neopixels(WS2812B) connected to pin 12. They are useful for showing pressure data visually.

Currently, the neopixel library is included in each example that uses them and neopixel related functions are defined in the example as well (see examples/jammingGripper). All the neopixel related code uses an instance of the Adafruit_Neopixel class. If the instance is defined in programmableAir.cpp, it is not accessible in the arduino example.

So the problem is, how to define aa Adafruit_Neopixel instance in programmableAir library and have it be accessible in an example which includes programmableAir library?

gabebear commented 4 years ago

I like having these separate. There are a couple neopixel/WS2812 libraries(e.g. FastLED). It's also nice to be able to pick the version of the ProgrammableAir library version and the version of the LED library independently.