Member Since: December 10, 2016
Country: India
Steps how to use Sparkfun SX1509 C++ Library on raspberry pi
you might be facing compilation errors when compiling SX1509 C++ library. Below are the few errors which i faced when compiling and steps to fix them.
Prerequisites
** To compile **
ERRORS
sx1509_registers.h:142:1: error: ‘uint8_t’ does not name a type uint8_t REG_I_ON[16] = {REG_I_ON_0, REG_I_ON_1, REG_I_ON_2, REG_I_ON_3, ^ sx1509_registers.h:147:1: error: ‘byte’ does not name a type byte REG_T_ON[16] = {REG_T_ON_0, REG_T_ON_1, REG_T_ON_2, REG_T_ON_3, ^
* Open the file sx1509_registers.h and replace "byte" with "unsigned char"
* and execute the command above.
* It should compile successfully and generate an object file "SparkFunSX1509.o" for you.
**Generate an archive library using "SparkFunSX1509.o" **
** Compile the demo file available in the ** github
* g++ main.cpp -o demo SparkFunSX1509.a -lwiringPi -lpthread -std=gnu++11
Demo executable is generated now successfully. Now you can run it on raspberry pi and explore more capabilities of SX1509 I/O Expander Breakout board
Steps how to use Sparkfun SX1509 C++ Library on raspberry pi
you might be facing compilation errors when compiling SX1509 C++ library. Below are the few errors which i faced when compiling and steps to fix them.
Prerequisites
** To compile **
ERRORS
sx1509_registers.h:142:1: error: ‘uint8_t’ does not name a type uint8_t REG_I_ON[16] = {REG_I_ON_0, REG_I_ON_1, REG_I_ON_2, REG_I_ON_3, ^ sx1509_registers.h:147:1: error: ‘byte’ does not name a type byte REG_T_ON[16] = {REG_T_ON_0, REG_T_ON_1, REG_T_ON_2, REG_T_ON_3, ^
* Open the file sx1509_registers.h and replace "byte" with "unsigned char"
* and execute the command above.
* It should compile successfully and generate an object file "SparkFunSX1509.o" for you.
**Generate an archive library using "SparkFunSX1509.o" **
** Compile the demo file available in the ** github
* g++ main.cpp -o demo SparkFunSX1509.a -lwiringPi -lpthread -std=gnu++11
Demo executable is generated now successfully. Now you can run it on raspberry pi and explore more capabilities of SX1509 I/O Expander Breakout board
No public wish lists :(