#define Souliss_T1n_Set
command in the T_19 documentation. But I'm not sure if this is helpful here and neither how to implement it properly into my sketch, --
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/c2c5e8f6-1515-4010-afcc-1e0abc63b833%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Dear Dario
I spent some time testing particular codes (trial'n error) with reference to your suggested T14-PWM -solution (pls. find above). As a beginner I think I have to sort out some particulars 1st to become more successful with my desired results ;)
(basic information: all tests have run through a routine as: 'drop DB' > restart soulissApp > 'get souliss nodes'. This is to prevent soulissApp errors and work with a fully renewed DB each time testing a modified sketch!)
My first question would be: I assume you suggested to add the T14-typical to my existing sketch - not to replace the T19-typical by T14. Pls could you confirm.
The 2nd question is: I assumed to find an option like 'set value (0-255)' using the T14-PWM-typical in soulissApp. Instead there was offered an 'OPEN' switch in the App. Does your T14-suggestion include a soulissApp related PWM-setting of brightness, or is this just code related (as in your sketchfrom which 100 would be a fixed brightness value) ?
mInput(slot_led_light+1) = 100; //brightness
Initially I've used the e03_RGBstrip example, modified it and replaced the relevant codes by the T19 typical (single LEDstrip). After my T14-testing I could only use the T14-typical 'open command' in soulissApp to turn on the test LED (Pin13) - no brightness variation possible.. The relevant part of my current sketch looks like
#define LEDCONTROL 0 // This is the memory slot for the logic that handle the light
#define LED 1 // This is the memory slot for the logic that handle the light
void setup()
{
Initialize();
// Set network parameters
SetAddress(0xD002, 0xFF00, 0xD001);
Set_T19(LEDCONTROL); // Set a logic to control a single colour LED strip
Set_T14(LEDCONTROL); // Set a logic to control a single colour LED strip
// Define inputs, outputs pins
pinMode(2, INPUT); // Hardware pulldown (R1: GND - 10k - Pins2) required
pinMode(13, OUTPUT); // Power the Arduino-onboard-LED
}
void loop()
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
// Execute the code every 1 time_base_fast
FAST_10ms() {
// Use Pin2 as ON/OFF command, use a pulldown resistor (10 k) connected between
// Pin2 and GND. Pressing for more than 1,5 seconds will set the GoodNight mode
// and the light will be progressly be turned off.
// It get the digital input state and store it in the LEDCONTROL logic
DigIn(2, Souliss_T1n_ToggleCmd, LEDCONTROL);
// Execute the logic that handle the LED
Logic_T19(LEDCONTROL);
Logic_T14(LEDCONTROL);
if(mOutput(LEDCONTROL)){
mInput(LED+1) = 100; //brightness
mInput(LED)= Souliss_T1n_Set;
}
// Use the output values to control the strip
analogWrite(13, mOutput(LED));
// Just process communication as fast as the logics
ProcessCommunication();
}
}
EXECUTESLOW()
{
UPDATESLOW();
SLOW_10s() {
// The timer handle timed-on states
// Timer_T14(LEDCONTROL);
}
}
}
I would be really grateful, if you could have a look at the code above and maybe give me a hint, how to modify it using the suggested T14-typical to get a independent brightness adaption in 'Scenes' working ! (of course I can also work with an related code example if this exists - adaption from working sketches is no problem for me. At least I hope ;))
Your help -as allways- is very appreciated in advance !!
Best regards, Niels
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/adb5a3da-7c07-4c88-9c0f-b90186ed06ec%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/b8ed11eb-910e-4d21-954d-06992945096f%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/cd71a02d-b722-4160-8392-a72c439734f3%40googlegroups.com.
void loop()
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
// Execute the code every 1 time_base_fast
FAST_10ms() {
// Use Pin2 as ON/OFF command - It get the digital input state and store it in the LEDCONTROL logic
DigIn(2, Souliss_T1n_ToggleCmd, LEDCONTROL);
// Execute the logic that handle the LED
Logic_T14(LED);
Logic_T19(LEDCONTROL);
if(mOutput(LED)){
while(mInput(LEDCONTROL+1) < 100) //brightness
{
mInput(LEDCONTROL+1)+=1;
mInput(LEDCONTROL)= Souliss_T1n_Set;
delay(10);
// mInput(LEDCONTROL+1) = 100; //brightness
// mInput(LEDCONTROL)= Souliss_T1n_Set;
}
}
// Use the output values to control the strip
analogWrite(13, mOutput(LEDCONTROL+1));
// Just process communication as fast as the logics
ProcessCommunication();
}
}
LED are non linear devices at this may be the answer of your problems.
I suggest you to print on the Serial monitor of the output value and slow in 500 ms steps, so that you can uderstand starting from which value you get some light.
Are you using a 3v3 or 5v output? How your LED is driven?
Dario.
From Mobile.
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/3de9cc61-d649-425e-99f6-2b85e027aecb%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CAKGhMPJwu6toWGHKwCSpuY9Jqf7tVFQq3b1GQt1XDdnOLFyRHg%40mail.gmail.com.
Pex rules!
From Mobile.
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/0dd12329-b155-487c-94cb-fdce00bcab99%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/b9b79302-9bcc-4672-8e78-8a8558fef515%40googlegroups.com.
Ok. Here a screenshot
You received this message because you are subscribed to a topic in the Google Groups "souliss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/souliss/s3pinqVBzE4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CAC2yfRiAG3v9NizyAzGh0pLdC%3D2rr4JMRvBUNSx41wkBqXZ60w%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CAN5yH6H67GCmCp2P1Ve8WpHcVSrgG9TBig8tZbPiPVtGbQhwmw%40mail.gmail.com.
Done
Regards
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/CAC2yfRg4ainVifimdWEyQL3YtNhkuuyx3%3DmmBCYfFJpOAhn2_A%40mail.gmail.com.
#define LEDCONTROL 0 // This is the memory slot(s) for the logic that handle the light - 2 Slots mandatory!
#define LED 2 // This is the memory slot for the logic that handle the light
void setup()
{
Initialize();
// Set network parameters
SetAddress(0xD002, 0xFF00, 0xD001);
Set_T19(LEDCONTROL); // Set a logic to control a single colour LED strip
Set_T14(LED); // Set a logic to control a single colour LED strip with set brightness
// Define inputs, outputs pins
pinMode(2, INPUT); // Hardware pulldown (R1: GND - 10k - Pins2) required
pinMode(13, OUTPUT); // Power the Arduino-onboard-LED
}
void loop()
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
// Execute the code every 1 time_base_fast
FAST_10ms() {
// Use Pin2 as ON/OFF command - It get the digital input state and store it in the LEDCONTROL logic
DigIn(2, Souliss_T1n_ToggleCmd, LEDCONTROL);
// Execute the logic that handle the LED
Logic_T14(LED);
Logic_T19(LEDCONTROL);
if(mOutput(LED)){
//mInput(LEDCONTROL+1) = 100;
// mInput(LEDCONTROL)= Souliss_T1n_Set;
while(mInput(LEDCONTROL+1) < 100) // fade-in brightness
{
mInput(LEDCONTROL+1)+=1; //visible 1000ms fade-in effect
mInput(LEDCONTROL)= Souliss_T1n_Set;
delay(10); // visible 1000ms fade-in effect
}
// Use the output values to control the strip
analogWrite(13, mOutput(LEDCONTROL));
// Just process communication as fast as the logics
ProcessCommunication();
}
}
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/40a71c41-830a-4b86-a911-1f1b4ae1f9d9%40googlegroups.com.
void loop()
{
// Here we start to play
EXECUTEFAST() {
UPDATEFAST();
// Execute the code every 1 time_base_fast
FAST_10ms() {
// Use Pin2 as ON/OFF command - It get the digital input state and store it in the LEDCONTROL logic
DigIn(2, Souliss_T1n_ToggleCmd, LEDCONTROL);
// Execute the logic that handle the LED
Logic_T14(LED);
Logic_T19(LEDCONTROL);
if(mOutput(LED)){
//mInput(LEDCONTROL+1) = 100;
// mInput(LEDCONTROL)= Souliss_T1n_Set;
while(mInput(LEDCONTROL+1) < 100) // fade-in brightness
{
mInput(LEDCONTROL+1)+=1; //visible 1000ms fade-in effect
mInput(LEDCONTROL)= Souliss_T1n_Set;
Logic_T19(LEDCONTROL); analogWrite(13, mOutput(LEDCONTROL+1));
delay(10); // visible 1000ms fade-in effect
}
// Use the output values to control the strip
analogWrite(13, mOutput(LEDCONTROL+1));
Hi Niels,
out of your sketch there is a lot of code that runs in the background. For the Souliss side this is the GatewayComms and PeerComms, if your node stucks into a while it will not process any communication task.
If you need to create longer cycle, instead of stuck into the while you should exit and going in at next cycle.
Dario.
From Mobile.
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/29446618-3f90-4638-ae8f-13bd2f2871a1%40googlegroups.com.
Logic_PulseOutput(SLOT002); //logig T_14 (PWM)
Logic_DimmableLight(SLOT000); //logic T_19
if(mOutput(SLOT002)){ //runs if T_14 being toggled
while(mOutput(SLOT000+1) < 150) // fade-up if current brightness < 150
{
mInput(SLOT000+1)=mOutput(SLOT000+1)+2; //max. total fade-time (150/2*6)=450 ms
mInput(SLOT000)= Souliss_T1n_Set;
Logic_DimmableLight(SLOT000);
analogWrite(13, mOutput(SLOT000+1)); // Output-Pin 13 onboard Arduino LED
delay(6); //
max. total fade-time 450 ms
}
while(mOutput(SLOT000+1) > 150) // fade-down to 150 brightness if current brightness > 150
{
mInput(SLOT000+1)=mOutput(SLOT000+1)-1; //
max. total fade-time 420 ms
mInput(SLOT000)= Souliss_T1n_Set;
Logic_DimmableLight(SLOT000);
analogWrite(13, mOutput(SLOT000+1)); // Output-Pin 13 onboard Arduino LED
delay(5); //
max. total fade-time 420 ms
}
analogWrite(13, mOutput(SLOT000+1)); // Output-Pin 13 onboard Arduino LED
FAST_PeerComms();
}
The memory is sized by default for 45 nodes and 24 slots, this is generally more than required for a mid size network.
You can increase this value affecting the RAM usage and the frame size on the network.
Dario.
From Mobile.
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/b2bf46e4-9618-4623-a3b4-6c18500fa507%40googlegroups.com.
These are global configuration values and should be consistent across all nodes. So the best is plan in advance if 24 are enough, if not increase this value from the beginning.
This will not be enough only if you use a single node as collector, like a Mega, with high number of I/O, but this isn't really a distributed approach.
In any case, it will work fine either.
Dario.
From Mobile.
Ok - this sounds quite sufficient for sure if it comes to home-automation frameworks.
I guess a max. of 24 slots is defined as default in Souliss per each single node. Is it possible to increase the max. number of slots per node if a very low number of total nodes is being used in the Souliss framework?
--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/83ef8e86-c538-4305-bca8-af2a91a31094%40googlegroups.com.