I am trying to follow the same steps, since I also want to move from Boblight to Hyperion.
I am using an Arduino with 4 simple led strips (whole led strip=same color. Bottom/left/top/right). Each led-strip is connected to 3 pins of the Arduino. So in my Boblight I have configured which led-strip is connected to which pins of the Arduino. Here is my problem: I cannot find out where to configure this part in Hyperion. I would expect to define the pin-mapping to the Arduino somewhere.
Does anyone know how to do this?
Solved it. In case anyone wants to know, I modified my arduino-sketch to wait for the prefix as described in above posts. Boblight does this differently from Adalight. I am using 4 led strips and hard-coded the prefix that I got from this post.
I also needed to manually set the delaAyAfterConnect=2000 for Hyperion. For some reason the Hypercon-configtool keeps setting it to 0.
/*
* boblight
* Copyright (C) Bob 2009
*
* boblight is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* boblight is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//Ada-compatible, for use with Hyperion
//For Adrduino mega
/* Order led-strips starting from top, clockwise
* 2 3 4 : right
* 5 6 7 : left
* 8 9 10 : top
* 11 12 13 : bottom
*/
uint8_t outputs[] = {8, 9, 10, 2, 3, 4, 11, 12, 13, 5, 6, 7};
//Hyperion sends (Hex) 0x41 0x64 0x61 0x00 0x03 0x56 = (Ascii) A d a null 3 V for 4 ledstrips
//Boblight sends 0x55 0xAA before start
uint8_t PREFIX[] = {0x41, 0x64, 0x61, 0x00, 0x03, 0x56};
const uint8_t PREFIX_SIZE = sizeof(PREFIX) / sizeof(uint8_t); // Save size of prefix array for convenience
uint8_t buffer[PREFIX_SIZE]; // Buffer for received prefix data
#define NROUTPUTS (sizeof(outputs))
uint8_t values[NROUTPUTS];
void setup()
{
Serial.begin(57600);
for (uint8_t i = 0; i < NROUTPUTS; i++)
analogWrite(outputs[i], 0);
}
void loop()
{
WaitForPrefix();
for (uint8_t i = 0; i < NROUTPUTS; i++)
{
while(!Serial.available());
values[i] = Serial.read();
analogWrite(outputs[i], values[i]);
}
}
//client needs to send prefix before sending the channel bytes
void WaitForPrefix()
{
uint8_t identical = 0;
while (identical != 1)
{
//shift left
for (uint8_t i=0; i<PREFIX_SIZE-1; i++)
buffer[i]=buffer[i+1];
while (!Serial.available()); //wait
buffer[PREFIX_SIZE-1] = Serial.read();
//compare
identical=1;
for (uint8_t i=0; i<PREFIX_SIZE; i++)
{
if (buffer[i]!=PREFIX[i]) identical=0;
}
}
}
Alles anzeigen