home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Language specific support
Deutsches MediaPortal Forum
Hard- und Software rund um den HTPC
Software
3rd Party Software
Atmowin/ Atmolight Plugin - System für SEDU und Arduino basiertes Ambilight
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Schicksal" data-source="post: 1051149" data-attributes="member: 101962"><p>@[USER=113375]montugar[/USER]</p><p>Ist das der Code von olli123?</p><p>Hab seinen an meine 8806 angepasst. Ich schau heute Abend mal nach.</p><p></p><p>Probier es mal hiermit:</p><p>[CODE]#include <FastSPI_LED2.h></p><p></p><p>//Set the number of leds in the strip.</p><p>#define NUM_LEDS 166</p><p></p><p>// Sometimes chipsets wire in a backwards sort of way</p><p>//struct CRGB {</p><p>// unsigned char g;</p><p>// unsigned char r;</p><p>// unsigned char b;</p><p>// };</p><p>// struct CRGB { unsigned char r; unsigned char g; unsigned char b; };</p><p>//struct CRGB *leds; alt</p><p>struct CRGB leds[NUM_LEDS];</p><p></p><p>#define PIN 4</p><p>#define DATA_PIN 11</p><p>#define CLOCK_PIN 13</p><p></p><p>void setup(){</p><p> Serial.begin(115200);</p><p> //FastSPI_LED.setLeds(NUM_LEDS); alt</p><p> LEDS.addLeds<LPD8806,BGR>(leds, NUM_LEDS);</p><p></p><p> //Change this to match your led strip</p><p> //FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2811);</p><p> </p><p></p><p> //If non-default SPI pins have been used change this.</p><p> //FastSPI_LED.setPin(PIN,11,13);</p><p> //FastSPI_LED.setPin(PIN);</p><p> //FastSPI_LED.setDataRate(5);</p><p></p><p> //LEDS.init();</p><p> LEDS.show();</p><p> //leds = (struct CRGB*)FastSPI_LED.getRGBData();</p><p> clearLeds();</p><p>}</p><p></p><p>int readByte(){</p><p> while(Serial.available()==0){</p><p> //LEDS.clear();</p><p>// clearLeds();</p><p> }</p><p> //LEDS.show();</p><p> return Serial.read();</p><p>}</p><p></p><p>void clearLeds(){</p><p> for(int tmpChannel=0; tmpChannel<NUM_LEDS; tmpChannel++){</p><p> leds[tmpChannel].b = 0;</p><p> leds[tmpChannel].r = 0;</p><p> leds[tmpChannel].g = 0; </p><p> };</p><p> //FastSPI_LED.show();</p><p>}</p><p></p><p>void FirstLight(){</p><p> // Move a single white led</p><p> for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {</p><p> // Turn our current led on to white, then show the leds</p><p> leds[whiteLed] = CRGB::White;</p><p></p><p> // Show the leds (only one of which is set to white, from above)</p><p> FastLED.show();</p><p></p><p> // Wait a little bit</p><p> delay(100);</p><p></p><p> // Turn our current led back to black for the next loop around</p><p> leds[whiteLed] = CRGB::Black;</p><p> }</p><p>} </p><p></p><p>void loop(){</p><p> //FirstLight();</p><p> </p><p> if(readByte() == 0xFF){</p><p> if(readByte() == 0x00){</p><p> if(readByte() == 0x00){</p><p> int channels = readByte();</p><p> for(int channel=0; channel<channels; channel++){</p><p> leds[channel].g = readByte();</p><p> leds[channel].r = readByte();</p><p> leds[channel].b = readByte();</p><p> }</p><p> FastSPI_LED.show();</p><p> }</p><p> }</p><p> }</p><p> else</p><p> {</p><p> //clearLeds();</p><p> //FastSPI_LED.stop();</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="Schicksal, post: 1051149, member: 101962"] @[USER=113375]montugar[/USER] Ist das der Code von olli123? Hab seinen an meine 8806 angepasst. Ich schau heute Abend mal nach. Probier es mal hiermit: [CODE]#include <FastSPI_LED2.h> //Set the number of leds in the strip. #define NUM_LEDS 166 // Sometimes chipsets wire in a backwards sort of way //struct CRGB { // unsigned char g; // unsigned char r; // unsigned char b; // }; // struct CRGB { unsigned char r; unsigned char g; unsigned char b; }; //struct CRGB *leds; alt struct CRGB leds[NUM_LEDS]; #define PIN 4 #define DATA_PIN 11 #define CLOCK_PIN 13 void setup(){ Serial.begin(115200); //FastSPI_LED.setLeds(NUM_LEDS); alt LEDS.addLeds<LPD8806,BGR>(leds, NUM_LEDS); //Change this to match your led strip //FastSPI_LED.setChipset(CFastSPI_LED::SPI_WS2811); //If non-default SPI pins have been used change this. //FastSPI_LED.setPin(PIN,11,13); //FastSPI_LED.setPin(PIN); //FastSPI_LED.setDataRate(5); //LEDS.init(); LEDS.show(); //leds = (struct CRGB*)FastSPI_LED.getRGBData(); clearLeds(); } int readByte(){ while(Serial.available()==0){ //LEDS.clear(); // clearLeds(); } //LEDS.show(); return Serial.read(); } void clearLeds(){ for(int tmpChannel=0; tmpChannel<NUM_LEDS; tmpChannel++){ leds[tmpChannel].b = 0; leds[tmpChannel].r = 0; leds[tmpChannel].g = 0; }; //FastSPI_LED.show(); } void FirstLight(){ // Move a single white led for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) { // Turn our current led on to white, then show the leds leds[whiteLed] = CRGB::White; // Show the leds (only one of which is set to white, from above) FastLED.show(); // Wait a little bit delay(100); // Turn our current led back to black for the next loop around leds[whiteLed] = CRGB::Black; } } void loop(){ //FirstLight(); if(readByte() == 0xFF){ if(readByte() == 0x00){ if(readByte() == 0x00){ int channels = readByte(); for(int channel=0; channel<channels; channel++){ leds[channel].g = readByte(); leds[channel].r = readByte(); leds[channel].b = readByte(); } FastSPI_LED.show(); } } } else { //clearLeds(); //FastSPI_LED.stop(); } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Language specific support
Deutsches MediaPortal Forum
Hard- und Software rund um den HTPC
Software
3rd Party Software
Atmowin/ Atmolight Plugin - System für SEDU und Arduino basiertes Ambilight
Contact us
RSS
Top
Bottom