In SX Microcontrollers, SX/B Compiler and SX-Key Tool, tdg8934 wrote: I was going through the code. See attached program. More specifically was the OUT subroutine which replaces the SHIFTOUT routine. It clearly shows the R1, R2, G1 and G2 datapins as well as Clock and Latch. However before it used pattern(temp1) to indicate the actual data being shifted. Using this new format, it is unclear how this is to be laid out. I am guessing something like: [b]pattern(temp1) = RB[/b] but really not sure. [code] SUB OUT bitmask = $80 FOR temp1 = 7 to 0 step -1 FOR hotdog = 1 to 8 B_R1 = R1 & bitmask ' 0 or bitmask B_R1 = B_R1 / bitmask ' 0 or 1 R1_Dpin = B_R1 B_R2 = R2 & bitmask ' 0 or bitmask B_R2 = B_R2 / bitmask ' 0 or 1 R2_Dpin = B_R2 B_G1 = G1 & bitmask ' 0 or bitmask B_G1 = B_G1 / bitmask ' 0 or 1 G1_Dpin = B_G1 B_G2 = G2 & bitmask ' 0 or bitmask B_G2 = B_G2 / bitmask ' 0 or 1 G2_Dpin = B_G2 ' the RB bits have been set, ready to pulse clock for external latch Pulsout S_Cpin, 2 bitmask = bitmask / 2 ' 1_$40, 2_$20, 3_$10, 4_$08, 5_$04, 6_$02, 7_$01, 8_XX NEXT [b]pattern(temp1) = RB[/b] NEXT PULSOUT L_Latch, 2 ' transfer to outputs ENDSUB You will see the FORWARD routine calls out the OUT subroutine which used before SHIFTOUT R1_Dpin, S_Clk, MSBFIRST, pattern(temp1) So where does pattern(temp1) fit into this new routine? Thanks! [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=273480#m273854 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)