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);
}
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.