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="montugar" data-source="post: 1050505" data-attributes="member: 113375"><p>Hallo ich habe das Problem wenn ich den Code für Fastspi2 hernehme auf meinen Arduino dann geht keine LED mehr an</p><p></p><p>Arduino UNO</p><p>LED Stripe LPD8806</p><p></p><p>kann mir jemand helfen wo ich einen Fehler gemacht habe.</p><p></p><p>vielen dank schon mal und einen guten Rutsch noch ins neue Jahr</p><p></p><p>[CODE]#include <FastSPI_LED2.h></p><p></p><p>//Set the number of leds in the strip.</p><p>#define NUM_LEDS 124</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 b;</p><p>// unsigned char r;</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 GND</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> //Change this to match your led strip</p><p> LEDS.addLeds<LPD8806>(leds, NUM_LEDS);</p><p></p><p> LEDS.show();</p><p> clearLeds();</p><p>}</p><p></p><p>int readByte(){</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].r = 0;</p><p> leds[tmpChannel].b = 0;</p><p> leds[tmpChannel].g = 0; </p><p> };</p><p>}</p><p></p><p>//For testing LEDS without RS232 just start this in loop()</p><p>void FirstLight(){</p><p> // Move a single white led</p><p> for(int whiteLed = 124; 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> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="montugar, post: 1050505, member: 113375"] Hallo ich habe das Problem wenn ich den Code für Fastspi2 hernehme auf meinen Arduino dann geht keine LED mehr an Arduino UNO LED Stripe LPD8806 kann mir jemand helfen wo ich einen Fehler gemacht habe. vielen dank schon mal und einen guten Rutsch noch ins neue Jahr [CODE]#include <FastSPI_LED2.h> //Set the number of leds in the strip. #define NUM_LEDS 124 // Sometimes chipsets wire in a backwards sort of way //struct CRGB { // unsigned char g; // unsigned char b; // unsigned char r; // }; // struct CRGB { unsigned char r; unsigned char g; unsigned char b; }; //struct CRGB *leds; alt struct CRGB leds[NUM_LEDS]; //#define PIN GND #define DATA_PIN 11 #define CLOCK_PIN 13 void setup(){ Serial.begin(115200); //FastSPI_LED.setLeds(NUM_LEDS); alt //Change this to match your led strip LEDS.addLeds<LPD8806>(leds, NUM_LEDS); LEDS.show(); clearLeds(); } int readByte(){ return Serial.read(); } void clearLeds(){ for(int tmpChannel=0; tmpChannel<NUM_LEDS; tmpChannel++){ leds[tmpChannel].r = 0; leds[tmpChannel].b = 0; leds[tmpChannel].g = 0; }; } //For testing LEDS without RS232 just start this in loop() void FirstLight(){ // Move a single white led for(int whiteLed = 124; 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 { } }[/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