How to change digital read from GPIO expander to onboard GPIO STM32

时间:2019-01-09 22:12:00

标签: c arduino stm32 lidar

I am trying to use a piece of sample code from the following github (https://github.com/stm32duino/X-NUCLEO-53L0A1) specifically, the gesture detection code, however, when the code attempts to setup the sensor on the i2c bus, it tries to set the xshutdown pin to one which is attached to a GPIO expansion board, and I would like to use the build in GPIO pins on my STM32 board. It seems pretty simple, but it's been causing me a little bit of trouble. If anyone has any help on this, I would greatly appreciate. Here is a link to the exact program I am trying to setup. (https://github.com/stm32duino/X-NUCLEO-53L0A1/blob/master/examples/X_NUCLEO_53L0A1_Gesture_DirSwipe/X_NUCLEO_53L0A1_Gesture_DirSwipe.ino)

The board which I am using is the STM32L4KC Nucleo.

The GPIO expander which the code is expecting is an STMPE1600.

This is the error I get when I simply try and replace the xshutdown pin variable with a pin number.

invalid conversion from 'int' to 'STMPE1600DigiOut*' [-fpermissive]

This is the line of code before I made the change to define the onboard GPIO pin.

xshutdown_left = new STMPE1600DigiOut(&DEV_I2C, GPIO_14, (0x43 * 2));

Additional info: I am actually trying to run the code with the raw sensors on breakouts rather than the dev kit. The raw sensors are called the VL53L0X. There might be a way to bypass setting up the sensors as 53L0A1 sensors and directly access the sensors. I'm guessing the 53L0A1 class just exposes the raw sensors through the GPIO expander.

Am I missing something here?

0 个答案:

没有答案