I have just started to play with the Yun SPI bus and it does not seem to work at all. I have used SPI loads of times and the Arduino SPI code looks really simple, the only change is setting select pin to 10 and the standard SPI functions.
I did have a teensy board hook up, but no just scoping out the pins and not seeing anything coming from the Yun.
// inslude the SPI library:
#include <Bridge.h>
#include <YunServer.h>
#include <YunClient.h>
#include <SPI.h>
// set pin 10 as the slave select for the digital pot:
const int slaveSelectPin = 10;
void setup() {
// set the slaveSelectPin as an output:
pinMode (slaveSelectPin, OUTPUT);
// initialize SPI:
SPI.begin();
}
void loop()
{
do{
digitalPotWrite(0x55, 0x55);
delay(1000);
}
while(1);
}
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);
}