Total noob looking for help...

Do you have a question on how to do something.
Ask in here.
Post Reply
NanoTrevor
Posts: 69
Joined: Thu Jun 02, 2011 1:58 pm

Total noob looking for help...

Post by NanoTrevor »

hey all first off my names Trevor and i have a 6 gallon nc. i just received my new reefangel and its awesome. just a couple dumb questions though, first whats the code for the pwm slope and where does it go, can it be changed via the gui? also the port assignment part of ragen gives me an error on upload? sorry if the questions are pretty basic, its just that im new to coding. for what its worth though if there are some explanations on whats going on with the code, i can be taught to fish and not just given a fish.

thanks
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Total noob looking for help...

Post by binder »

The PWM code is already to be used. It needs to be placed inside the loop() function. See this topic for examples of where and how to use the code. http://forum.reefangel.com/viewtopic.php?f=12&t=16

The PWM slope cannot be changed via the gui. You have to manually code it in like in the thread.

What exactly is the error on the upload with the code?

curt
NanoTrevor
Posts: 69
Joined: Thu Jun 02, 2011 1:58 pm

Re: Total noob looking for help...

Post by NanoTrevor »

hey curt, thanks for the response. i did see the pwm slope thread you linked to im still a bit confused though, i know the code where i would define the lighting times and ramp and such, but what is the code a little further down with more obscure coding jargon? does that to need to be plugged into the pde? and if i plug it in do i need to remove anything? also when i look at the demo pde i dont see the loop area your speak of in the other post. sorry and thanks
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Total noob looking for help...

Post by binder »

This is the only code you need to be concerned about:

Code: Select all

    // Have PWM on from 9a to 6p, with gradual 60 minute ramp up and down starting at the given times
    // From 9a to 10a, the PWM will slowly ramp from 0% to 100%
    // From 5p to 6p, the PWM will slowly ramp from 100% to 0%
    ReefAngel.PWM.SetActinic(PWMSlope(9,0,18,0,0,100,60,ReefAngel.PWM.GetActinicValue()));
    ReefAngel.PWM.SetDaylight(PWMSlope(9,0,18,0,0,100,60,ReefAngel.PWM.GetDaylightValue()));
When you generate a PDE file to be uploaded, it's going to loop something like this:
(Keep in mind, this is just a template/skeleton of the PDE)

Code: Select all

// PDE name
#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
//... other include statements

// global function defines and web banner stuff (if enabled)

void setup()
{
    ReefAngel.Init();
    ReefAngel.Relay.On(Port8);
}

void loop()
{
    ReefAngel.ShowInterface();
    ReefAngel.StandardLights(Port2);
    ReefAngel.Wavemaker1(Port4);
    // INSERT PWM code from above here
    // Rest of function calls
}
This is the standard template that gets generated by ragen. The demo software will have the loop() function but it's really long with lots of other code in it.

curt
NanoTrevor
Posts: 69
Joined: Thu Jun 02, 2011 1:58 pm

Re: Total noob looking for help...

Post by NanoTrevor »

thanks curt
Post Reply