After debugging the led array is correct. I simplified the debugging by trying to output to a single LED. Again, works on arduino but not netduino. What is happening on the netduino is twice the specified LEDS is changing to random colors. So if I specifiy 1 LED it will affect 2 LEDs, if I specify 3 it will affest 6.
Here's the post_frame function, I commented out the arduino line and put the .NET line below it. I don't see why it would cause those problems.
//Takes the current strip color array and pushes it out private void post_frame() { //Each LED requires 24 bits of data //MSB: R7, R6, R5..., G7, G6..., B7, B6... B0 //Once the 24 bits have been delivered, the IC immediately relays these bits to its neighbor //Pulling the clock low for 500us or more causes the IC to post the data. for (int LED_number = 0; LED_number < _LEDS.Length; LED_number++) { int this_led_color = _LEDS[LED_number]; //24 bits of color data for (byte color_bit = 23; color_bit != 255; color_bit--) { //Feed color bit 23 first (red data MSB) //digitalWrite(CKI, LOW); //Only change data when clock is low _clock.Write(false); //int mask = 1L << color_bit; int mask = 1 << color_bit; //The 1'L' forces the 1 to start as a 32 bit number, otherwise it defaults to 16-bit. if ((this_led_color & mask) != 0) //digitalWrite(SDI, HIGH); _data.Write(true); else //digitalWrite(SDI, LOW); _data.Write(false); //digitalWrite(CKI, HIGH); //Data is latched when clock goes high _clock.Write(true); } } //Pull clock low to put strip into reset/post mode //digitalWrite(CKI, LOW); //delayMicroseconds(500); //Wait for 500us to go into reset _clock.Write(false); DelayMicroSec(500); } /// <summary> /// Blocks thread for given number of microseconds /// </summary> /// <param name="microSeconds">Delay in microseconds</param> private void DelayMicroSec(int microSeconds) { DateTime startTime = DateTime.Now; int stopTicks = microSeconds * 10; TimeSpan divTime = DateTime.Now - startTime; while (divTime.Ticks < stopTicks) { divTime = DateTime.Now - startTime; } }