Sketch Problem With MCP Pot

I'm trying to write a simple to send a value to a dual pot MCP4261.

I keep get an error when I compile.

Can anyone point out my error

// include the SPI library:
#include <SPI.h>

// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 4;
const int address = 0;
const int value = 255;

void setup() {
// set the slaveSelectPin as an output:
pinMode (slaveSelectPin, OUTPUT);
// initialize SPI:
SPI.begin();
}

void digitalPotWrite(int address, int value)
{
// take the SS pin low to select the chip:
digitalWrite(slaveSelectPin,LOW);
// send in the address and value via SPI:
SPI.transfer(address);
SPI.transfer(value);
// take the SS pin high to de-select the chip:
digitalWrite(slaveSelectPin,HIGH);
}

Where have you hidden the loop() function ?

It would help if you said what the error message is. I'll guess that it's something about a loop function not being defined.

Posting code snippets in code tags is good idea also.

Thanks for the snippet comment

Here's error msgs

C:\Users\LARIAN~1\AppData\Local\Temp\build8364529739229085721.tmp/core.a(main.cpp.o): In function main': C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to loop'
collect2: error: ld returned 1 exit status
Error compiling.

So, are you going to tell up where the loop() function is in your program ?

Lucky for you that I've got a spare loop() function that I don't need, so please feel free to add this to your sketch:

void loop()
{
}

That should make your sketch compile, but it still won't work. Any guesses why?

Thanks for the spare loop - very kind to a newbie

And yes, I had a function defined in a function

Got it working

Thank you