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
HTPC Projects
Hardware
Ambient Lighting System
AtmoDuinoBox - multi protocol arduino code for ambient lights
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="kenwonders" data-source="post: 1186517" data-attributes="member: 29743"><p>This may have limited interest to most, as usually you will setup your ardiuino for the light system you wish to use then forget about it.</p><p></p><p>However, due to various reasons (like testing) I wanted to be able to leave the arduino alone and run up AtmoWin (in either AtmoDuino or V2 mode) or Ambibox and have them still work. Because they have different headers, this requires something a little different. The solution here will accept any header from the above (could be more later) through a matching method, it does appear to work VERY well at speed.</p><p></p><p>To use:</p><p>1. Please already know your FastLED config before trying this, as it's always best to get the lights working with the 'FirstLight' example <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>//-----------------------EDITABLE CONFIGURATION</p><p>#define NUM_LEDS 176</p><p>#define LED_TYPE WS2812B</p><p>#define DATA_PIN 11</p><p>//#define CLOCK_PIN 0</p><p>#define COLOUR_ORDER RGB</p><p>#define SERIAL_SPEED 512000</p><p>//-----------------------EDITABLE CONFIGURATION</p><p></p><p>2. Edit the top section with your configuration, if you use LEDs with a clock pin, uncomment CLOCK_PIN, give it a value and swap the FastLED.addLeds line in 'setup()'</p><p>3. The default speed I set here is 512,000, which is supported in the following ways:</p><ul> <li data-xf-list-type="ul">Ambibox: 'AtmoDuino' section from SerialPortConfig.ini in the Ambibox program files dir</li> <li data-xf-list-type="ul">Atmowin: Requires 1.0.0.9 from AtmoWin thread, change speed in device configuration option.</li> </ul><p>4. Try other speed values. If you have only a few LEDs then the standard arduino 115,200 will work ok, however that is not enough bandwidth for larger amounts of LEDs. It is also common to have some lower speeds fail despite higher ones working, most Unos can go pretty fast.</p><p>5. Hope it works for you <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p></p><p>Info about the detection for those interested:</p><p>I worked out how to calculate the correct 4 bytes for each header type, this means you only need to enter the NUM_LEDS value:</p><p>AtmoDuinoV2 - <strong>0xD7, 0xEE, 0x23, NUM_LEDS - 1</strong></p><p>AtmoDuino on Ambibox - <strong>0xFF, 0x00, 0x00, NUM_LEDS * 3</strong> - this value can overflow, but when truncated the byte leftover is matching ambibox, so that is what ambibox appears to do too</p><p>AtmoDuino on AtmoWin - <strong>0xFF, 0x00, 0x00, NUM_LEDS</strong></p><p></p><p>So that the loop is not complex, it is only ensuring each header part received matches at least one predefined header, but it could do better. If anyone better at that sort of thing (I tried a success array but it took too long) then please let me know.</p></blockquote><p></p>
[QUOTE="kenwonders, post: 1186517, member: 29743"] This may have limited interest to most, as usually you will setup your ardiuino for the light system you wish to use then forget about it. However, due to various reasons (like testing) I wanted to be able to leave the arduino alone and run up AtmoWin (in either AtmoDuino or V2 mode) or Ambibox and have them still work. Because they have different headers, this requires something a little different. The solution here will accept any header from the above (could be more later) through a matching method, it does appear to work VERY well at speed. To use: 1. Please already know your FastLED config before trying this, as it's always best to get the lights working with the 'FirstLight' example :) //-----------------------EDITABLE CONFIGURATION #define NUM_LEDS 176 #define LED_TYPE WS2812B #define DATA_PIN 11 //#define CLOCK_PIN 0 #define COLOUR_ORDER RGB #define SERIAL_SPEED 512000 //-----------------------EDITABLE CONFIGURATION 2. Edit the top section with your configuration, if you use LEDs with a clock pin, uncomment CLOCK_PIN, give it a value and swap the FastLED.addLeds line in 'setup()' 3. The default speed I set here is 512,000, which is supported in the following ways: [LIST] [*]Ambibox: 'AtmoDuino' section from SerialPortConfig.ini in the Ambibox program files dir [*]Atmowin: Requires 1.0.0.9 from AtmoWin thread, change speed in device configuration option. [/LIST] 4. Try other speed values. If you have only a few LEDs then the standard arduino 115,200 will work ok, however that is not enough bandwidth for larger amounts of LEDs. It is also common to have some lower speeds fail despite higher ones working, most Unos can go pretty fast. 5. Hope it works for you :) Info about the detection for those interested: I worked out how to calculate the correct 4 bytes for each header type, this means you only need to enter the NUM_LEDS value: AtmoDuinoV2 - [B]0xD7, 0xEE, 0x23, NUM_LEDS - 1[/B] AtmoDuino on Ambibox - [B]0xFF, 0x00, 0x00, NUM_LEDS * 3[/B] - this value can overflow, but when truncated the byte leftover is matching ambibox, so that is what ambibox appears to do too AtmoDuino on AtmoWin - [B]0xFF, 0x00, 0x00, NUM_LEDS[/B] So that the loop is not complex, it is only ensuring each header part received matches at least one predefined header, but it could do better. If anyone better at that sort of thing (I tried a success array but it took too long) then please let me know. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
HTPC Projects
Hardware
Ambient Lighting System
AtmoDuinoBox - multi protocol arduino code for ambient lights
Contact us
RSS
Top
Bottom