Matlab, Phidgets, and shift registers

Legacy support with Phidget21
timmil

Matlab, Phidgets, and shift registers

Postby timmil » Tue Oct 11, 2011 9:37 pm

Hi Guys,
This is one of my first projects with a phidget and I may be in over my head.

I want to control a 64 LED dot matrix using two 74HC164 shift registers- one on the rows, the other on the columns.

Right now, though, I can't get the shift registers to do anything at all! I might not be understanding fundamentally how they work, but just to test my code I tried to run some LEDs connected directly to each output pin of the shift register. I give it a code like this:

dc1=1;
cc=0;
reset=6;
setDOUT(7,1)
setDOUT(reset,1)
setDOUT(reset,0)
setDOUT(1,0)


for i=1:8

pause(1/125)
setDOUT(cc,0)

pause(1/125)
if a(1,i)==1 %sets active columns
setDOUT(dc1,1)
else
setDOUT(dc1,0)
end
end

end

where dc1 is the data channel and cc is the clock channel, and a is just a vector of 1s and 0s. I just want to be able to illuminate the LEDs, what am I doing wrong?

thanks!

Tim

Return to “Matlab”

Who is online

Users browsing this forum: No registered users and 2 guests