board707 / DMD_STM32

STM32Duino library for RGB, Monochrome and Two-color led matrix panels
GNU General Public License v3.0
71 stars 22 forks source link

SPIClass #34

Closed leonhutton closed 1 year ago

leonhutton commented 1 year ago

Hi, sorry for what I'm sure is a simple question: When I compile the dmd_demo sketch in Arduino, I get the following message:

_Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Generic STM32F1 series, Generic F103C8Tx, STM32CubeProgrammer (SWD), Enabled (generic 'Serial'), None, Low/Full Speed, Smallest (-Os default), None, Newlib Nano (default)"

dmd_demo:48:19: error: no matching function for call to 'SPIClass::SPIClass(int)'

48 | SPIClass dmd_spi(2);

  |                   ^

In file included from \Documents\Arduino\libraries\DMD_STM32-old-V1/DMD_STM32.h:47,

             from \Documents\Arduino\libraries\DMD_STM32-old-V1\examples\STM32F1\dmd_demo\dmd_demo.ino:42:

\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:114:5: note: candidate: 'SPIClass::SPIClass(uint32_t, uint32_t, uint32_t, uint32_t)'

114 | SPIClass(uint32_t mosi, uint32_t miso, uint32_t sclk, uint32_t ssel = PNUM_NOT_DEFINED);

  |     ^~~~~~~~

\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:114:5: note: candidate expects 4 arguments, 1 provided

\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:113:5: note: candidate: 'SPIClass::SPIClass()'

113 | SPIClass();

  |     ^~~~~~~~

\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:113:5: note: candidate expects 0 arguments, 1 provided

\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:111:7: note: candidate: 'constexpr SPIClass::SPIClass(const SPIClass&)'

111 | class SPIClass {

  |       ^~~~~~~~

C:\Users\Leon.Hutton\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:111:7: note: no known conversion for argument 1 from 'int' to 'const SPIClass&'

C:\Users\Leon.Hutton\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:111:7: note: candidate: 'constexpr SPIClass::SPIClass(SPIClass&&)'

C:\Users\Leon.Hutton\Documents\ArduinoData\packages\STMicroelectronics\hardware\stm32\2.4.0\libraries\SPI\src/SPI.h:111:7: note: no known conversion for argument 1 from 'int' to 'SPIClass&&'

exit status 1

no matching function for call to 'SPIClass::SPIClass(int)'_

Any ideas? I suspect something simple I am doing wrong...

board707 commented 1 year ago

Hi According to this:

ArduinoData\packages\STMicroelectronics

you use STM32 package from STMicro. The library is required STM32 package by Roger Clark, https://github.com/rogerclarkmelbourne/Arduino_STM32

leonhutton commented 1 year ago

Thankyou so much for your help. When I get my project going I will share the results!