I grabbed the code from here, http://jeremyblum.com/2011/02/20/ardu… and am trying it on a AD8801 - spec sheet - http://www.analog.com/static/imported-f … 1_8803.pdf -and it turns on the LEDs on outputs 1-4 no problem, voltage as it should be but outputs 5-8 are only going up in voltage to about 1.9 so the LEDs do not com on. I dont get it.
//Program by Jeremy Blum
//www.jeremyblum.com
//Changes LED brightness using voltag input instead of PWM
//Include SPI library
#include <SPI.h>
void setup()
{
//Set Pin Direction
//Again, the other SPI pins are configured automatically
pinMode(SS, OUTPUT);
//Initialize SPI
SPI.begin();
}
//This will set 1 LED to the specififed level
void setLed(int reg, int level)
{
digitalWrite(SS, LOW);
SPI.transfer(reg);
SPI.transfer(level);
digitalWrite(SS, HIGH);
}
void loop()
{
for(int i=0; i<=7; i++)
{
for (int j=50; j<=255; j++)
{
setLed(i,j);
delay(20);
}
delay(500);
for (int j=255; j>=50; j--)
{
setLed(i,j);
delay(20);
}
}
}