@Nca78 Yes, I was actually thinking using DIP switch (or even more easy to read thumbwheel switch) to give a unique ID to each node! As soon as I receive the extra radio modules I ordered, I'll test that.
@Grubstake I'm afraid you're right! But it's ok to have just a few days of battery life. As I wrote, it might be often disassembled and reassembled.
@Samuel235 said:
Just one of many ideas, the possibilties are endless. I'de always go for RGB leds over just white, allows for more customisation while able to still give you the same white as the white leds.
... unless, as in my use case, colors are not needed.
I'm too stingy to pay for the unused dry powder!
@krisztian
Hi krisztian,
the singleLED board - as its name suggests - features only one LED output. If you want to have a setup with multiple LED strips you need to design a board with multiple outputs. I have already designed a board with 4 outputs, but I haven't built it.
In terms of software you need to register multiple sensors in your program like this:
#define numCh 4 //the number of outputs
const byte ledPins[] = {9,6,5,3};
byte ledLevel[numCh];
boolean ledDimWay[numCh];
//in the setup function request the dim levels from the gateway
for(byte i=0; i<numCh; i++) request(i, V_DIMMER);
//in the presentation function register multiple lights
for(byte i=0; i<numCh; i++) present(i, S_DIMMER);
//if you receive a signal, you need to check for the sensor id
setLED(message.sensor, requestedLevel);
//to set the LED level (function: setLED) you need to use the sensor id to determine brightness and pin
//Fade LED to set level
int delta = (level - ledLevel[child]) < 0 ? -1 : 1;
//Write to LED
analogWrite(ledPins[child], map(ledLevel[child],0,100,0,255));
I will probably publish the whole code once I have built and tested the 4LED controller (i call it "MySensors rainbowLED")
Hope I could help you
ThetaDev
Thanks for the answers. For sure it is possible to buy an ATmega and even a full-featured debugger would be acceptable compared to the effort of porting. But still, I am very biased towards the PIC without logical or economical arguments.
I did not yet work with the mysensors libraries and only browsed quickly through the github repo. Maybe someone can give me a few hints to estimate the effort deeper than just claiming it as "much workload"?
What I see so far is:
make the C++ code compile (translate to C with clang/llvm and compile with the XC8 compiler)
create a new HAL (in hal/architecture) which seems not too much effort for making it initially working
Questions:
Do I see it right, that there is a linux-port available? -> I would expect much more effort to port from AVR to linux than to port it to a different MCU
What about the licensing? It looks like the code is GPLv2, but in the CLA it seem that contributors need to give away their rights on the contributions and that mysensors can even redistribute the code under another license - which seems completely against the principles of the GPL. Can someone explain that in more detail?