Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Change clock rate in "Toolbox.NETMF.Hardware.RgbLedStrip"

SPI Clock

  • Please log in to reply
No replies to this topic

#1 SteveS123

SteveS123

    Member

  • Members
  • PipPip
  • 21 posts
  • LocationMissouri

Posted 05 February 2014 - 06:35 PM

I'm trying the clock rate of the Toolbox.NETMF.Hardware>RgbLedStrip library but can't seem to succeed.

The library offers no access to the clock rate.

 

Steps taken so far:

1. Try to access the RgbLedStrip library.  - no access to clock settings

2. Instantiated a new spi.config and set it to SPI_Devices.SPI1.  - The changes in the new config didn't change my output.

 

The question is, how do I change the clock speed of the SPI while using the NETMF toolbox?

 

Here is the test code.

 

public class Program
    {
        private static RgbLedStrip Chain = new RgbLedStrip(RgbLedStrip.Chipsets.WS2801, 114, SPI.SPI_module.SPI1);  //45 count on FLOOR and 150 count for CAN
 
        public static void Main()
        {
            SPI.Configuration spiDevice1 = new SPI.Configuration(Pins.GPIO_PIN_D10, false, 0, 0, false, false, 100, SPI_Devices.SPI1);
            //The line above is supposed to set the SPI1 config.  I am trying to set the clock rate to 100 but there is no change in my program.
            //I even tried instantiating the "RgbLedStrip" with the above "spiDevice1" and still no change to the clock speed.
            while (true)
            {
                for (int i = 0; i < 74; i++)
                {
                    Chain.SetColor(i, 0x34BAC6, false);
                    Thread.Sleep(1);
                }
 
                for (int i = 74; i < 114; i++)
                {
                    Chain.SetColor(i, 0xFFFFFF, false);
                    Thread.Sleep(5);
                }
                Thread.Sleep(5000);
                Chain.SetColorAll(0x000000, false);
           }
       }
   }
             






Also tagged with one or more of these keywords: SPI Clock

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.