Multiple Light Phases, Is It Possible?

New members questions
Post Reply
psantillana
Posts: 6
Joined: Wed Jun 12, 2013 10:41 pm

Multiple Light Phases, Is It Possible?

Post by psantillana »

hi. i just got my RA yesterday and it's up and running. i'm a super newbie and i don't have any idea how to code (worst combination, i know).

just wanted to ask if it's possible to make a code to have multiple phases (cycles) repeating in 1 day for my LEDs on the basic RA unit? i don't have any of the expansion packs. multiple phases like 0630-0930 then moonlight until 1100-1400 then moonlight again until 1700-1900 then moonlight until the next day. i only have a FOWLR setup so no issues with this light schedule like for those with corals. my main concern is that in an 8- or 12-hour cycle, light is on practically the whole day so algae outbreak might be a concern later on.

if possible, hope you can send me the code here. all my connections are standard/basic setup. moonlight is on port 2, actinic on port 3 and daylight on port 4. if not possible, hope you can offer me alternatives like the "clouds passing" that i see in some discussions here.

will really appreciate it if you could help.

thank you
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Multiple Light Phases, Is It Possible?

Post by rimai »

Try this:

Code: Select all

  if (hour()<10)
  {
    ReefAngel.StandardLights(Port3,6,30,9,30);
    ReefAngel.StandardLights(Port4,6,30,9,30);
    ReefAngel.MoonLights(Port2,9,30,6,30);
  }
  else if (hour()>=10 && hour()<14)
  {
    ReefAngel.StandardLights(Port3,11,0,14,0);
    ReefAngel.StandardLights(Port4,11,0,14,0);
    ReefAngel.MoonLights(Port2,14,0,11,0);
  }
  else
  {
    ReefAngel.StandardLights(Port3,17,0,19,0);
    ReefAngel.StandardLights(Port4,17,0,19,0);
    ReefAngel.MoonLights(Port2,19,0,17,0);
  }
Roberto.
psantillana
Posts: 6
Joined: Wed Jun 12, 2013 10:41 pm

Re: Multiple Light Phases, Is It Possible?

Post by psantillana »

thanks for the quick response roberto. i am not sure if i was that clear but here's the summary of the light cycle that i was targeting:

CYCLE 1
actinic (port 3) ON 0630 OFF 0930
daylight (port 4) ON 0630 OFF 0930
moonlight (port 2) OFF 0630 ON 0930

CYCLE 2
actinic (port 3) ON 1100 OFF 1400
daylight (port 4) ON 1100 OFF 1400
moonlight (port 2) OFF 1100 ON 1400

CYCLE 3
actinic (port 3) ON 1700 OFF 2000
daylight (port 4) ON 1700 OFF 2000
moonlight (port 2) OFF 1700 ON 2000

hope it is how you understood my initial query. sorry, i should have done it this way the first time.

and lastly, do i just copy paste this code on the arduino software screen, connect my RA and upload it? it will just overwrite the old code?

again, thank you so much for the great support.
psantillana
Posts: 6
Joined: Wed Jun 12, 2013 10:41 pm

Re: Multiple Light Phases, Is It Possible?

Post by psantillana »

i tried verifying the code using the arduino software (i chose the REEF ANGEL BOARD) and this is what it said:

The following features were automatically added:
Watchdog Timer
Version Menu

The following features were detected:
java. io.FileNotFoundException: /Users/Paul/Documents/Arduino/update/feature.txt (No such file or directory)
at java. io.FileInputStream.open(Native Method) ----- had to move the .io as it detects it as a URL link
at java. io.FileInputStream.<init>(FileInputStream.java:120)
at java. io.FileInputStream.<init>(FileInputStream.java:79)
at java. io.FileReader.<init>(FileReader.java:41)
at processing.app.Sketch.ProcessFeature(Sketch.java:1373)
at processing.app.Sketch.build(Sketch.java:1766)
at processing.app.Sketch.build(Sketch.java:1750)
at processing.app.Editor$DefaultRunHandler.run(Editor.java:1867)
at java.lang.Thread.run(Thread.java:680)
Simple Menu
java. io.IOException: No such file or directory
at java. io.UnixFileSystem.createFileExclusively(Native Method)
at java. io.File.checkAndCreate(File.java:1705)
at java. io.File.createTempFile0(File.java:1726)
at java. io.File.createTempFile(File.java:1803)
at processing.app.Base.saveFile(Base.java:2189)
at processing.app.Sketch.ProcessFeature(Sketch.java:1456)
at processing.app.Sketch.build(Sketch.java:1766)
at processing.app.Sketch.build(Sketch.java:1750)
at processing.app.Editor$DefaultRunHandler.run(Editor.java:1867)
at java.lang.Thread.run(Thread.java:680)
sketch_jun14a:0: error: expected unqualified-id before 'if'
sketch_jun14a:6: error: expected unqualified-id before 'else'
sketch_jun14a:12: error: expected unqualified-id before 'else'

are the "error: expected unqualified-id before 'if'" and "error: expected unqualified-id before 'else'" a concern? thank you
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple Light Phases, Is It Possible?

Post by lnevo »

Looks like something wrong with your install..
psantillana
Posts: 6
Joined: Wed Jun 12, 2013 10:41 pm

Re: Multiple Light Phases, Is It Possible?

Post by psantillana »

lnevo wrote:Looks like something wrong with your install..
hi inevo. so it's my install not the code? i'm not sure if this is a string of a code that i need to add to a main code or if this is it already.

thanks for your response
User avatar
lnevo
Posts: 5422
Joined: Fri Jul 20, 2012 9:42 am

Re: Multiple Light Phases, Is It Possible?

Post by lnevo »

The error does not appear to be code related. Try removing and reinstalling
Post Reply