Library - Voorbeelden
Voor de opdracht “Je eigen library en applicatie” is het handig vooraf te kijken hoe zo’n library normaliter uitziet.
Er zijn honderden voorbeelden van libraries in het Internet.
De TI-S2 C++ docenten hebben enkele Arduino-libraries bekeken en aantekeningen gemaakt.
Overview Arduino Libraries
Link:
Simple Sensor Library example
Support for the Arduino Nano 33 BLE Sense board to read air pressure abd temperature.
Links:
Remarks:
- (+) small example, good to get an overview
- (-) no Doxygen-comments
- (-) Hardcoded i2c connection (not usable for e.g. Arduino Due)
Simple CRC32 Library example
Links:
Remarks:
- (+) small example
- (+) shows handling of AVR PROGMEM versus other architectures
- (-) fixed generator polynomial, table-driven generation
- (-) no Doxygen-comments
JSON library example
Links:
Remarks:
- (-) complex memory handling
- (-) only wraps cJSON (therefore also not much documentation, only examples)
FIRMATA library
Links:
Remarks:
- (+) uses Doxygen for documentation (-) in *.cpp files
- (+) ‘behind the scenes’ look into a universal communications library
- (-) complex
TFT Library
Links:
Remarks:
- (+) uses Adafruit components
- (+) shows use of different SPI variants (software/hardware) for constructor
- (+) shows a table-driven initializer
- (-) complex, supports fonts and SD-card files
Adafruit NeoPixel
Links:
Remarks:
Stepper Motor Driver
Links:
Remarks:
- (+) shows how to write code to use various hardware
- (+) shows how to use a template function
- (-) no Doxygen-comments (so no Arduino-site documentation is generated) (+) other comments are useful
- (-) complex (+) but BasicStepperDriver is a good example