SPI function calling error for Arduino Leonardo

Hi. I'm new to Arduino and recently I've been trying to implement a digital potentiometer using a MAX 5487 IC Chip connected to an Arduino Leonardo. I've been trying to upload the code to the Arduino however I keep getting the error that says no matching function for call to "SPIClass::begin(int&, int) despite having already installed the SPI Library. Any help would be greatly appreciated. The code I written is as follows:

#include <SPI.h>

int ssPin = 10;

void setup(){
pinMode(ssPin, OUTPUT);
digitalWrite(ssPin, LOW);
SPI.begin(ssPin, LOW);
}
void loop(){
for(int i =0; i <= 255; i++)
{
SPI.transfer(0);
SPI.transfer(i);
delay(10);
}
for(int i =0; i <= 255; i--)
{
SPI.transfer(0);
SPI.transfer(i);
delay(10);
}
}

Please follow the advice given in the link below when posting code. Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

SPI.begin() does not take any parameters

Hello,
i think you will use the ssPin himself looks like this:

for(int i =0; i <= 255; i++)
{
digitalWrite(ssPin, LOW);
SPI.transfer(0);
SPI.transfer(i);
digitalWrite(ssPin, HIGH);
delay(10);
}

because HIGH State on the ssPin Line says the MAX that he will take the Data's.
And the 0 in the first SPI.transfer ar not Affektet in the MAX. Read the Datasheet on Page 9 witch Datas you will be send.
Sorry for my bad English.
lgbk

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.