Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
chipkit_ledboard [2015/03/10 20:20] – [Step 5: Software] Joshua Woldstadchipkit_ledboard [2015/03/10 20:21] – [Step 5: Software] Joshua Woldstad
Line 110: Line 110:
 Here we can provide how LEDs we are running (900), which pin the data is going to be used to connect to the data line on the LEDs (pin 3 in our case), and the desired color mode. Marshall's library supports two different color modes: GRB (RGB in a different order), and HSV. Our snake game happens to be using HSV since that allowed more flexibility for the user to choose both a color and the brightness. Here we can provide how LEDs we are running (900), which pin the data is going to be used to connect to the data line on the LEDs (pin 3 in our case), and the desired color mode. Marshall's library supports two different color modes: GRB (RGB in a different order), and HSV. Our snake game happens to be using HSV since that allowed more flexibility for the user to choose both a color and the brightness.
  
-We can get the LEDs lit up and running by first calling in our setup the +We can get the LEDs lit up and running by first calling in our setup the name_of_the_set_of_LEDs.begin();
- +
-name_of_the_set_of_LEDs.begin(); +
 function and then choose the settings of the LEDs and subsequently update the strip of LEDs with our new values. function and then choose the settings of the LEDs and subsequently update the strip of LEDs with our new values.
- +For HSV color mode, you can set the hue, saturation, and value. For those of you that might not know, these values roughly translate to the color, how "bold" a particular color is instead of being washed out, and how "bright" a color is instead of being dark, respectively. These are all set with the following function: name_of_the_set_of_LEDs.HSVsetLEDColor(which_LED_out_of_your_set_you_want_to_change, hue, saturaturation, value); 
-For HSV color mode, you can set the hue, saturation, and value. For those of you that might not know, these values roughly translate to the color, how "bold" a particular color is instead of being washed out, and how "bright" a color is instead of being dark, respectively. These are all set with the following function: +This function will only set (but not yet update) the values on just one LED, so it's recommend to use a for loop to change multiple LED values. To update the LEDs so that they all show their new settings (or old if that particular LED was not updated), simply issue the following command: name_of_the_set_of_LEDs.refreshLEDs(); 
- +The refresheLEDs() function utilizes port manipulation and assembly code to make for a tight library so very little time is wasted in sending out the new information to the WS2812 LEDs at their designated data rate. You can check out a screen shot of the HSV demo for this library in the picture for this step. 
-name_of_the_set_of_LEDs.HSVsetLEDColor(which_LED_out_of_your_set_you_want_to_change, hue, saturaturation, value); +
- +
-This function will only set (but not yet update) the values on just one LED, so it's recommend to use a for loop to change multiple LED values. +
- +
-To update the LEDs so that they all show their new settings (or old if that particular LED was not updated), simply issue the following command: +
- +
-name_of_the_set_of_LEDs.refreshLEDs(); +
- +
-The refresheLEDs() function utilizes port manipulation and assembly code to make for a tight library so very little time is wasted in sending out the new information to the WS2812 LEDs at their designated data rate. +
- +
-You can check out a screen shot of the HSV demo for this library in the picture for this step.+
  
 Go [[http://chipkit.net/started/learn-basics/party-libraries/|here]] for a tutorial on installing libraries to MPIDE. Go [[http://chipkit.net/started/learn-basics/party-libraries/|here]] for a tutorial on installing libraries to MPIDE.
  
 Download [[http://www.instructables.com/files/orig/FJO/6KW3/I6NI5AL5/FJO6KW3I6NI5AL5.zip|Snake]], then upload the program onto the uC32.  Download [[http://www.instructables.com/files/orig/FJO/6KW3/I6NI5AL5/FJO6KW3I6NI5AL5.zip|Snake]], then upload the program onto the uC32.