Cloud and Lightning Code
Re: Cloud and Lightning Code
Awesome! I've always thought that the best way to learn something was to do it. I'm sure I'll have questions.
--Colin
--Colin
Re: Cloud and Lightning Code
The lightning will have to be incorporated in the slave side. The cloud should be fine.
The RANet bandwidth is not fast enough.
It sends data every 100ms.
The RANet bandwidth is not fast enough.
It sends data every 100ms.
Roberto.
Re: Cloud and Lightning Code
Slave side? Esplain please.rimai wrote:The lightning will have to be incorporated in the slave side. The cloud should be fine.
The RANet bandwidth is not fast enough.
It sends data every 100ms.
--Colin
Re: Cloud and Lightning Code
Every RANet-Ready Wireless Module has a microcontroller in it to receive and process the wireless data.
The current firmware can only process data for relays and dimming channels.
We will need to create a firmware that can accept commands, so you can trigger remotely.
For example, a command to trigger the lightning effect on the dimming module.
You are not the only one that will want this.
The person using the dimmable LED driver wants this too.
I just need to find some time to put something together, but I'd like to release the next libs first.
The RANet requires some changes on the core libraries released from Arduino, specifically the SoftwareSerial library and I'd like to have at least the base communication working and released before we start adding functionality to it.
We have been getting some help from Sacohen, lnevo, AlanM, binder and others to see if any other minor bug is found.
Hopefully, we get a release soon.
The current firmware can only process data for relays and dimming channels.
We will need to create a firmware that can accept commands, so you can trigger remotely.
For example, a command to trigger the lightning effect on the dimming module.
You are not the only one that will want this.
The person using the dimmable LED driver wants this too.
I just need to find some time to put something together, but I'd like to release the next libs first.
The RANet requires some changes on the core libraries released from Arduino, specifically the SoftwareSerial library and I'd like to have at least the base communication working and released before we start adding functionality to it.
We have been getting some help from Sacohen, lnevo, AlanM, binder and others to see if any other minor bug is found.
Hopefully, we get a release soon.
Roberto.
Re: Cloud and Lightning Code
I updated the previous post.
I meant to say RANet-Ready Wireless Module and not RANet-Add On.
I meant to say RANet-Ready Wireless Module and not RANet-Add On.
Roberto.
Re: Cloud and Lightning Code
Ah, I see. Load the sequence and then trigger when needed. I understand.
--Colin
--Colin
Re: Cloud and Lightning Code
And I thought that just coding this for the dimming expansion would work. I don't know how to code much of anything but would be happy to test anything you come up with.
Re: Cloud and Lightning Code
I feel like a bit of an idiot, but I can't seem to find this line:
byte LightningModes[] = { Slow, Fast, Mega };
To even start this programming. Is there an updated full code I need to find somewhere before attempting to customize this?
byte LightningModes[] = { Slow, Fast, Mega };
To even start this programming. Is there an updated full code I need to find somewhere before attempting to customize this?
Re: Cloud and Lightning Code
The updated code is in the first post.
Do a search for this:
And change it to your liking.
--Colin
Do a search for this:
Code: Select all
byte LightningModes[] = { Mega, Mega, Mega2, Calm, Calm };
--Colin
Re: Cloud and Lightning Code
Found it! Thanks!
-
- Posts: 188
- Joined: Fri Dec 30, 2011 6:57 am
Re: Cloud and Lightning Code
Has anyone had any luck modifying this code to work on the dimmer expansion module yet?
I'm getting ready to redo my entire coding for my tank upgrade and was hoping to incorporate clouds/lightning.
I'm getting ready to redo my entire coding for my tank upgrade and was hoping to incorporate clouds/lightning.
Re: Cloud and Lightning Code
Is there a way to write values directly to the dimming expansion? That's key. Otherwise it won't be fast enough for the right effect.
--Colin
--Colin
Re: Cloud and Lightning Code
Actually the wired dimming has a fast enough connection. The wireless one is the one that doesn't.
Roberto.
-
- Posts: 188
- Joined: Fri Dec 30, 2011 6:57 am
Re: Cloud and Lightning Code
Lee, is that because you haven't had time to try or because you ran into issues/errors that still need to be worked out? If it's simply a matter of changing just the PMWValue variables, maybe I'll try to take a stab at it.
In fact, I'll take a look at it now and see if I can figure it out. I'll report back here if I get it working.
I have wired connection dimmer expansion, so I should be good to go.
In fact, I'll take a look at it now and see if I can figure it out. I'll report back here if I get it working.
I have wired connection dimmer expansion, so I should be good to go.
Re: Cloud and Lightning Code
The obstacle is here, in the analogWrite statement. That bypasses the RA libraries to write directly to the daylight pin. It's the only way to get fast enough flashes.
If you want to convert it, you'd need to find an equivalent way to write to the expansion module.
--Colin
Code: Select all
int a=random(1,5); // Pick a number of consecutive flashes from 1 to 4.
for (int i=0; i<a; i++)
{
analogWrite(daylightPWMPin,random(DaylightPWMValue*2.55,255)); // Flash on
int randy=random(20,80); // Random number for a delay
if (randy>71) randy=((randy-70)/2)*100; // Small chance of a longer delay
delay(randy); // Wait from 20 to 69 ms, or 100-400 ms
analogWrite(daylightPWMPin,DaylightPWMValue*2.55); // Flash off
delay(random(30,50)); // Wait from 30 to 49 ms
wdt_reset();
}
--Colin
Re: Cloud and Lightning Code
Sorry if this is a dumb question. Can i use this code to add lightning and cloud to my main white and actinic channels with the output from the relay box dimming ports, and then use the channels 0-3 on dimming expansion (using 4-5 for dc pumps) with the wizard generated code for the my other colored leds, green red uv and 2700k white? i have a diy led with steves led drivers and 6 different color leds over my 180 currently controlled by a typhoon. or would it not get the same effect because the other channels won't have the effect. I was hoping this might work because the main number of leds is white and actinic leds. i didnt realize when i ordered the dimming module and plus upgrade last week that the custom lighting codes had not been written for dimming module because the design had changed. I have very high hopes with the dimming module and just want to use my leds to their full potential! or is the code getting close to be finished for the new dimming module?
Re: Cloud and Lightning Code
From what I understand this code only works on the relay dimming channels, it hasn't be ported over to the dimming hub yet. So I will work on your white and actinic lights only.
The dimming channel 1-3 will be normal dimming only.
The dimming channel 1-3 will be normal dimming only.
Re: Cloud and Lightning Code
Colin has already ported and made it even better when used with the dimming module.
Let's have him pitch in
Let's have him pitch in
Roberto.
Re: Cloud and Lightning Code
It's ported to the RANet Dimming Expansion, but that code could be adapted. The issue noted a few posts above has been solved. It's just a matter of putting it all together.
I don't have a standard dimming expansion, so there may be some trial and error. I'll see if I can come up with something over the next week or so.
--Colin
I don't have a standard dimming expansion, so there may be some trial and error. I'll see if I can come up with something over the next week or so.
--Colin
Re: Cloud and Lightning Code
Roberto, is the address of the standard dimming expansion 0x40? I'm guessing it's the same dimming unit used in the RANet version?
Re: Cloud and Lightning Code
That awesome.cosmith71 wrote:It's ported to the RANet Dimming Expansion, but that code could be adapted. The issue noted a few posts above has been solved. It's just a matter of putting it all together.
I don't have a standard dimming expansion, so there may be some trial and error. I'll see if I can come up with something over the next week or so.
--Colin
Re: Cloud and Lightning Code
JTMBTech:
Do you want the Daylight channel, and expansion channels 0-3 to flash? Actinic doesn't flash.
--Colin
Do you want the Daylight channel, and expansion channels 0-3 to flash? Actinic doesn't flash.
--Colin
- Rodasphoto
- Posts: 187
- Joined: Wed Apr 10, 2013 2:48 pm
- Location: Athens, Ga
- Contact:
Re: Cloud and Lightning Code
Anyone have noise to accompany the flash?
Re: Cloud and Lightning Code
If the code only effects the white I would want to put my 2700 k white on one chanel, I was thinking 2700k white on relay box and 6300k white either on the same chanel or one of the chanels on the dimming expansion my other led chanels I can put on the remaining dimming expansion chanels, and the actinic chanel. Is the white normally the only chanel that flashes/changes? I just wanted to know if it was possible to use the relay box white output on storm and the expansion dimming ports on standard, however if the code has been ported to the dimming ex pansies I am sure it will work.
Re: Cloud and Lightning Code
Normally it's just the white that flashes, but that's just personal preference. We can make any channels you like flash.
Re: Cloud and Lightning Code
So this code only works from the relay dimming ports, which are 0-10v, but you can only get the quick lightning flashes using LDD type drivers, 0-5v. Am i missing something here?
Re: Cloud and Lightning Code
If you have a modified relay box you can get 0-5v from the dimming ports. I thought the dimming module version had been sorted out. I'll look into it.
--Colin
--Colin
Re: Cloud and Lightning Code
Officially adapted for the 6 channel Dimming Expansion Module.
http://forum.reefangel.com/viewtopic.php?f=12&t=5460
--Colin
http://forum.reefangel.com/viewtopic.php?f=12&t=5460
--Colin