ive tried everything... it just doesent want to work! I started making my own code to test it and see if it workks, and i'm getting some results. I've succesfully made 4 colors on one row that can light up every button the same color by delaying them very fast. And also for some reason, the second digital pot won't work, even though i change slave select to 10... Does anything else need to be changed, or can everything stay the same except for slave select?
ok, so i tinkered around some more, and now i have half the buttons light up diffrent colors. Ill post a pic or maybe a vid on the tube.
I also half figured out why i couldent get the second digital pot working....:
i unhooked all the color wires from the second pot when i was re checking everything...
i only found it out when one wire accidentally touched a resistor, and the whole row 3rd row turned blue.
and 1 more thing...
in the first version you complained of the very very lack of bright intense colors, but ever since i removed the transistors AND the resistors connecting to the arduino pins, the arduino dident break, and the colors are so bright i can bring them into fairly bright rooms and still see them well....
hopefully when i hook up the other 2 rows, the current doesent add up and murder my arduino...
if you know this will happen, please warn me
and i have a youtube video up, showin it, also read the description because i purposely slow down the refresh rate...:http://youtube.com/watch?v=tlI9Vino97E&feature=RecentlyWatched&page=1&t=t&f=b
ok ok, only 1 more edit...
so i keep trying to make the second digital pot work, but it seems not to be working...
i hooked up the rest of the rgb led's the same way i hooked up the first digital pot, and i changed the slave select on my arduino code and the same thing thats been happening on the first side, is not happening on the other. I'll post the code further down... So i'm guessing that exactly the same thing should happen on the other side, but it doesent seem to do anything similarly... It doesent even have a refresh rate like the first pot, cuz when i slow it down with the pot, it doesent stop.
can you see my code and tell me if you see anything faulty please?
#define DATAOUT 11//MOSI
#define DATAIN 12//MISO - not used, but part of builtin SPI
#define SPICLOCK 13//sck
#define SLAVESELECT 10//ss*** it is either 10, or 18
byte potpin = 0;
char spi_transfer(volatile char data)
SPDR = data; // Start the transmission
while (!(SPSR & (1<<SPIF))) // Wait the end of the transmission
return SPDR; // return the received byte
digitalWrite(SLAVESELECT,HIGH); //disable device
// SPCR = 01010000
//interrupt disabled,spi enabled,msb 1st,master,clk low when idle,
//sample on leading edge of clk,system clock/4 (fastest)
SPCR = (1<<SPE)|(1<<MSTR);
byte write_pot(int address, int value)
//2 byte opcode
digitalWrite(SLAVESELECT,HIGH); //release chip, signal end transfer
potpin = analogRead(0)/5+1;
looks ok to me.. and it works on the first digital pot....