I followed this article to motor esc control.
After I open setThrottle.pro with ‘Qt Creator’ and then I did configure Project.
After click ‘build all’ I got an error.
Ubuntu 18.04 uses SMBus differently than earlier versions. So I added header file
extern “C” {
#include <i2c/smbus.h>
}
But still got an error.
/home/jetson/jetsonRACECAR/research/build-setThrottle-Desktop-Debug/JHPWMPCA9685.o:-1: In function `PCA9685::readByte(int)':
/home/jetson/jetsonRACECAR/research/setThrottle/JHPWMPCA9685.cpp:91: error: undefined reference to `i2c_smbus_read_byte_data'
/home/jetson/jetsonRACECAR/research/build-setThrottle-Desktop-Debug/JHPWMPCA9685.o:-1: In function `PCA9685::writeByte(int, int)':
/home/jetson/jetsonRACECAR/research/setThrottle/JHPWMPCA9685.cpp:106: error: undefined reference to `i2c_smbus_write_byte_data'
:-1: error: collect2: error: ld returned 1 exit status
I don’t know what should I do Please help.
I’m using tx2 with Jetpack 4.2